Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A...
-
Upload
marybeth-bennett -
Category
Documents
-
view
221 -
download
2
Transcript of Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A...
![Page 1: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/1.jpg)
Operating Systems
Scheduling
![Page 2: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/2.jpg)
Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process.
Scheduling – Process Behavior
![Page 3: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/3.jpg)
• Batch• Interactive• Real time
Categories of Scheduling Algorithms
![Page 4: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/4.jpg)
Some goals of the scheduling algorithm under different circumstances.
Scheduling Algorithm Goals
![Page 5: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/5.jpg)
• First Come First Served• Shortest Job First• Shortest Remaining-time Next• High Response-radio First
Batch Systems are usually non-preemptible.
Scheduling in Batch Systems
![Page 6: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/6.jpg)
Important variables
• Arrival time / Finish time (point)• Waiting time / Executing time (period)• Turnaround time = Waiting time + Executing time
= Finish time – Arrival time• Weighting turnaround time
= Turnaround time / Executing time• Response radio = Turnaround time / Executing time
= 1 + Waiting time / Executing time
![Page 7: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/7.jpg)
An example of shortest job first scheduling. (a) Running four jobs in the original order. (b) Running them
in shortest job first order.
Shortest Job First
![Page 8: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/8.jpg)
• Round-robin scheduling• Priority scheduling• Multiple queues• Shortest process next• Guaranteed scheduling• Lottery scheduling• Fair-share scheduling
Scheduling in Interactive Systems
![Page 9: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/9.jpg)
Round-robin scheduling. (a) The list of runnable processes. (b) The list of runnable
processes after B uses up its quantum.
Round-Robin Scheduling
![Page 10: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/10.jpg)
A scheduling algorithm with four priority classes.
Priority Scheduling
![Page 11: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/11.jpg)
11
Scheduling in Real-Time Systems
Schedulable real-time system
Givenm periodic events
event i occurs within period Pi and requires Ci seconds
Then the load can only be handled if
1
1m
i
i i
C
P
![Page 12: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/12.jpg)
12
Policy versus Mechanism
Separate what is allowed to be done with how it is donea process knows which of its children threads are important and need
priority
Scheduling algorithm parameterizedmechanism in the kernel
Parameters filled in by user processespolicy set by user process
![Page 13: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/13.jpg)
(a) Possible scheduling of user-level threads with a 50-msec process quantum and threads that run 5 msec per CPU burst.
Thread Scheduling (1)
![Page 14: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/14.jpg)
(b) Possible scheduling of kernel-level threads with the same characteristics as (a).
Thread Scheduling (2)
![Page 15: Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.](https://reader035.fdocuments.in/reader035/viewer/2022062309/56649f2c5503460f94c4761c/html5/thumbnails/15.jpg)