A presentation on different CPU scheduling algorithms such as SJF, RR and FIFO detailed explanation with advantages and disadvantages of each algorithm. This ppt also contains brief information about the multiprocessor scheduling and the performance evaluation of Scheduling algorithms.
Processing & Properties of Floor and Wall Tiles.pptx
Process scheduling algorithms
1. C.K.PITHAWALA COLLEGE OF
ENGINEERING & TECHNOLOGY, SURAT
Branch:- computer 2nd Year/4th SEM
ALA Subject:- Operating System
ALA Topic Name:- CPU Scheduling Algorithms
Group No:-B4
Roll No. Enrolment No Name
Submitted To
Manan Shah
Divyesh Mistry
403
405
401
420
459
160090107051
160090107049
160090107025
160090107044
160090107059
Shubham Sharma
Pakshal Shah
Hariom Maurya
Pravin Rathod
Naitik Vajani
Chetan Sir
Yogesh Sir
2. Process Scheduling Algorithms: FCFS – SJF – RR ,
Multiprocessor scheduling :
Types , Performance evaluation of the scheduling
4. FIFO
• First come first serve scheduling method.
• Non-preemptive CPU scheduling algorithm.
• A queue is maintained containing the list of processes in the CPU.
• The processes are dispatched according to their arrival time at a ready queue.
CPU
Ready
queue
5. FIFO
Advantages
• Simple to implement
• Fine for most of the batch operating
systems
Disadvantages
• It cannot guarantee short response
time.
• Turnaround time is unpredictable.
• Average waiting time is often quite
long.
7. Shortest Job First : SJF
• SJF algorithm handles the process based on the length of their CPU cycle time, the
process with shortest runtime is completed first.
• SJF scheduling algorithm may be preemptive or non-preemptive.
• It is optimal only when all the processes are available at the same time and the CPU
estimates are available.
8. Shortest Job First : SJF
Advantages
• Used frequently in long term scheduling.
• It reduces average waiting time over FIFO algorithm.
• It is appropriate for batch jobs for which run times are knows in advance.
Disadvantages
• It requires precise knowledge of how long a job or process will run which is not easily
available.
9. Shortest Job First : SJF
PROCESS BURST TIME
P1 5
P2 2
P3 6
P4 4
P2 P4 P1 P3
0 2 6 11 17
10. Round Robin : RR
• In RR algorithm, each process is given a limited amount of time slice and after the time
expires the system allocates the CPU to next process in the ready queue.
• RR is a preeemptive scheduling algorithm.
• Here the ready queue is treated as a circular queue and follows FIFO scheme.
• The CPU scheduler goes around the ready queue allocating the CPU to each process for
given time interval.
11. Round Robin : RR
Advantages
• It is a simple scheduling
algorithm and easy to implement
in software.
• Round robin scheduling is fair in
the sense that every process gets
an equal share of the CPU.
• If we know the number of
processes on the run queue, we
can know the worst-case
response time for a process.
Disadvantages
• If slicing time is too low, the
processor output is reduced.
More time is spent on context
switching.
• Higher Average Waiting Time
• No priority: Round-robin
scheduling, like other first-come,
first-served methods, doesn't
give special priority to more
important tasks
12. Round Robin : RR
PROCESS BURST TIME
P1 5
P2 2
P3 6
P4 4
P3 P2 P3 P4 P1 P3 P4 P1 P3
0 2 4 6 8 10 12 14 15 17
Time Slice = 2 s
13. Multiprocessor Scheduling
• Scheduling is two dimensional on a multiprocessor.
• Scheduling on a multiprocessor involves three issues:
a. The assignment of processes to processors.
b. The use of multiprogramming on individual processors.
c. The actual dispatching of a process.
• A key design issue for a multiprocessor scheduling is the selection of process for
execution.
• A more sophisticated scheduling based on priority and past usage may lead to a better
performance, compared with simpler FIFO algorithm.
14. Multiprocessor Scheduling
• Multiprocessing environment can be achieved with the help of threads.
• An application can be implemented as a set of threads, which cooperate and execute
concurrently in the same address space.
• Four general approaches of multiprocessor thread scheduling are:
• Load sharing : Here threads are not assigned to a particular processor, when a processor is
idle, it selects a thread from a global queue serving all processors.
• Gang scheduling : A set of related threads is scheduled to run on a set of processors at the
same time, on a one-to-one basis.
• Dedicated processor scheduling : When application is scheduled, its threads are assigned to a
processor.
• Dynamic scheduling : No. of threads are altered dynamically by the application.
15. Performance Evaluation of the Scheduling
• Performance evaluation of CPU Scheduling algorithm is done by the following 3
methods:
• Deterministic Modelling : It uses analytic method. It takes a particular predetermined
workload and defines the performance of each algorithm for that workload.
• Queuing Models : In this method, a queueing model is constructed so that queue lengths and
waiting time can be predicted for the given scheduling algorithm.
• Simulations : Simulations creates a model of the system, then processes statistical on real
data based on which necessary evaluation is done.