queue header PCB PCB2 head queue tail registers registers mag head tape unit 0 maghead tape PCB 3 PCB 14 unit 1 disk head unit 0 PCB terminal head unit
ready queue CPU 10 queue 10 request time slice child fork a executes child interrupt it for an occurs interni Figure 3.6-Queueing-diagram representation of process scheduling
Figure 3.6 - Queueing-diagram representation of process scheduling
Schedulers Short-term scheduler or CPU scheduler)-selects which process should be executed next and allocates cpu Sometimes the only scheduler in a system Short-term scheduler is invoked frequently milliseconds )must be fast) Long-term scheduler or job scheduler)-selects which processes should be brought into the ready queue in a batch system, selects processes spooled in a mass-storage device and loads them into memory) Long-term scheduler is invoked infrequently(seconds, minutes(may be slow) The long-term scheduler controls the degree of multiprogramming time-sharing systems such as UNIX and Microsoft Windows systems often have no long-term scheduler
- Schedulers • Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU • Sometimes the only scheduler in a system • Short-term scheduler is invoked frequently (milliseconds)(must be fast) • Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue (in a batch system, selects processes spooled in a mass-storage device and loads them into memory) • Long-term scheduler is invoked infrequently (seconds, minutes) (may be slow) • The long-term scheduler controls the degree of multiprogramming • time-sharing systems such as UNIX and Microsoft Windows systems often have no long-term scheduler
Some systems also employ a medium-term scheduler remove process from memory, store on disk, bring back in from disk to continue execution: swapping An efficient scheduling system will select a good process mix of CPU bound processes and l o bound processes y0-bound process-spends more time doing l o than computations, many short cpu bursts CPU-bound process-spends more time doing computations; few very long CPU bursts
• Some systems also employ a medium-term scheduler . • remove process from memory, store on disk, bring back in from disk to continue execution: swapping • An efficient scheduling system will select a good process mix of CPUbound processes and I/O bound processes. • I/O-bound process – spends more time doing I/O than computations, many short CPU bursts • CPU-bound process – spends more time doing computations; few very long CPU bursts
swap in partially executed swap out swapped-out processes ready queue CPU 1/0 waiting queues Figure 3.7-Addition of a medium-term scheduling to the queueing diagram
Figure 3.7 - Addition of a medium-term scheduling to the queueing diagram