Assignment Report on CPU Scheduling Algorithm

Are you stuck up with your Assignment Report on the CPU Scheduling Algorithm? Get Assignment Solutions on CPU Scheduling Algorithm at the minimum price. Assignmenthelpaus.com has a great team of experienced writers who assist you with online assignment services.

order-now

 

Assignment Detail:-

  • Number of Words: 1500

 

CPU Scheduling is a process of determining which process will own CPU for execution while another process is on hold. 

  • The main task of CPU scheduling is to make sure that whenever the CPU remains idle, the OS at least select one of the processes available in the ready queue for execution. 
  • The selection process will be carried out by the CPU scheduler. 
  • It selects one of the processes in memory that are ready for execution.

 

  • There are two types of CPU Scheduling Algorithm
  • Non-pre-emptive
  • Pre-emptive

 

  • Preemptive Scheduling
  • In Preemptive Scheduling, the tasks are mostly assigned with their priorities
  • Sometimes it is important to run a task with a higher priority before another lower priority task, even if the lower priority task is still running. 
  • The lower priority task holds for some time and resumes when the higher priority task finishes its execution.

 

  • Non-Preemptive Scheduling
  • In this type of scheduling method, the CPU has been allocated to a specific process. 
  • The process that keeps the CPU busy will release the CPU either by switching context or terminating. 
  • It is the only method that can be used for various hardware platforms. 
  • That’s because it doesn’t need special hardware (for example, a timer) like preemptive scheduling.

 

When scheduling is Preemptive or Non-Preemptive?

  • To determine if scheduling is preemptive or non-preemptive, consider these four parameters:

1.A process switches from the running to the waiting state.

2.Specific process switches from the running state to the ready state.

3.Specific process switches from the waiting state to the ready state.

4.Process finished its execution and terminated.

 

  • Only conditions 1 and 4 apply, the scheduling is called non- preemptive.

All other scheduling are preemptive.

Important CPU scheduling Terminologies

  • Arrival Time:Time at which the process arrives in the ready queue.

 

  • Completion Time:Time at which process completes its execution.

 

  • Burst Time:Time required by a process for CPU execution.

 

  • Turn Around Time:Time Difference between completion time and arrival time.

  Turn Around Time = Completion Time – Arrival Time

 

  • Waiting Time(W.T):Time Difference between turnaround time and burst time.

  Waiting Time = Turn Around Time – Burst Time

 

Types of CPU scheduling Algorithm

There are mainly six types of process scheduling algorithms

  • First Come First Serve (FCFS)
  • Shortest-Job-First (SJF) Scheduling
  • Shortest Remaining Time
  • Priority Scheduling
  • Round Robin Scheduling
  • Multilevel Queue Scheduling

 

First Come First Serve

  • It is the easiest and most simple CPU scheduling algorithm. 
  • In this type of algorithm, the process which requests the CPU gets the CPU allocation first. 
  • This scheduling method can be managed with a FIFO queue.
  • As the process enters the ready queue, its PCB (Process Control Block) is linked with the tail of the queue.
  • So, when CPU becomes free, it should be assigned to the process at the beginning of the queue.

 

Characteristics of FCFS method

  • It offers non-preemptive and pre-emptive scheduling algorithm.
  • Jobs are always executed on a first-come, first-serve basis
  • It is easy to implement and use.
  • However, this method is poor in performance, and the general wait time is quite high.

 

Shortest Job First (SJF)

  • SJF is a scheduling algorithm in which the process with the shortest execution time should be selected for execution next. 
  • This scheduling method can be preemptive or non-preemptive. 
  • It significantly reduces the average waiting time for other processes awaiting execution.

 

Characteristics of SJF Scheduling

  • It is associated with each job as a unit of time to complete. 
  • In this method, when the CPU is available, the next process or job with the shortest completion time will be executed first. 
  • It is Implemented with non-preemptive policy. 
  • This algorithm method is useful for batch-type processing, where waiting for jobs to complete is not critical. 
  • It improves job output by offering shorter jobs, which should be executed first, which mostly have a shorter turnaround time 

 

Priority Based CPU Scheduling Algorithm

  • Priority scheduling is a method of scheduling processes based on priority. 
  • In this method, the scheduler selects the tasks to work as per the priority.
  • Priority scheduling also helps OS to involve priority assignments. 
  • The processes with higher priority should be carried out first, whereas jobs with equal priorities are carried out on a round-robin or FCFS basis. 
  • Priority can be decided based on memory requirements, time requirements, etc.

 

Round Robin Scheduling

  • Round robin is the oldest, simplest scheduling algorithm. 
  • The name of this algorithm comes from the round-robin principle, where each person gets an equal share of something in turn. 
  • It is mostly used for scheduling algorithms in multitasking. 
  • This algorithm method helps for starvation free execution of processes.

 

Characteristics of RR Scheduling

  • Round robin is a hybrid model which is clock-driven
  • Time slice should be minimum, which is assigned for a specific task to be processed. However, it may vary for different processes.
  • It is a real time system which responds to the event within a specific time limit.

 

Shortest Job First (SJF) Scheduling

  • SJF is a scheduling algorithm in which the process with the shortest execution time should be selected for execution next.
  • This scheduling method can be preemptive or non-preemptive.
  • It significantly reduces the average waiting time for other processes awaiting execution.

 

Characteristics of SJF Scheduling

  • It is associated with each job as a unit of time to complete.
  • In this method, when the CPU is available, the next process or job with the shortest completion time will be executed first.
  • It is Implemented with non-preemptive policy.
  • This algorithm method is useful for batch-type processing, where waiting for jobs to complete is not critical.
  • It improves job output by offering shorter jobs, which should be executed first, which mostly have a shorter turnaround time

 

Multi-level Queues Scheduling

  • This algorithm separates the ready queue into various separate queues. In this method, processes are assigned to a queue based on a specific property of the process, like the process priority, size of the memory, etc.
  • However, this is not an independent scheduling OS algorithm as it needs to use other types of algorithms in order to schedule the jobs.

 

Characteristics of Multi-level Queue Scheduling

  • Multiple queues should be maintained for processes with some characteristics.
  • Every queue may have its separate scheduling algorithms.
  • Priorities are given for each queue.

 

Purpose of Scheduling

  • The CPU uses scheduling to improve its efficiency.
  • It helps you to allocate resources among competing processes.
  • The maximum utilization of CPU can be obtained with multi-programming.
  • The processes which are to be executed are in ready queue.

 

Assignment

  • Write a report on different CPU Scheduling Algorithms, its advantages and disadvantages in various operating systems.

 

For REF… Use: #getanswers2001887