Os 11
Os 11
CSE
By
Dr. Mitul Kumar Ahirwal
Ref: Books:
“Operating system concepts” Abraham Silberschatz and Peter B Galvin
“Operating system” Andrew S. Tanenbaum
“Operating system a concept based Approach” D.M Dhamdhere 1 1
Time Quantum and Context Switch Time
2
Turnaround Time (TAT) Varies With The Time Quantum (q)
General Rule:
80% of CPU bursts should
be shorter than q
3
Example of SRTF
4
Example of Preemptive Priority
5
Multilevel Queue
• Ready queue is partitioned into separate queues, eg:
– foreground (interactive)
– background (batch)
• Process remains in a given queue
• Each queue has its own scheduling algorithm:
– foreground – RR
– background – FCFS
7
Multilevel Feedback Queue
• A process can move between the various queues;
aging can be implemented this way
8
Example of Multilevel Feedback Queue
• Three queues:
– Q0 – RR with time quantum 8 milliseconds
– Q1 – RR time quantum 16 milliseconds
– Q2 – FCFS
• Scheduling
– A new job enters queue Q0 which is served FCFS
• When it gains CPU, job receives 8 milliseconds
• If it does not finish in 8 milliseconds, job is moved to queue Q1
– At Q1 job is again served FCFS and receives 16 additional
milliseconds
• If it still does not complete, it is preempted and moved to queue Q2
9
Multilevel Feedback Queues
10
Reference:
Silberschatz, Galvin and Gagne
©2009 Operating System Concepts –
8th Edition