I/O-bound programs use very little computation while being performed and so do not use up their entire CPU quantum. CPU programs use their entire quantum without blocking the I/O operations.
6.16 – Consider the following set of processes, with the length of the CPU burst given milliseconds:
Process
P1
P2
P3
P4
P5
Burst Time
2
1
8
4
5
Priority
2
1
4
2
3
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
(a) Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non-preemptive priority (a larger priority number implies a higher priority), and RR (quantum = 2).
FCFS
------------------------------------------------------------------------------------
| P1 | P2 | P3 | P4 | P5 |
------------------------------------------------------------------------------------
0 2 3 11 15 20
SJF
------------------------------------------------------------------------------------
| P2 | P1 | P4 | P5 | P3 |
------------------------------------------------------------------------------------
0 1 3 7 12 20
Non-preemptive priority
------------------------------------------------------------------------------------
| P2 | P1 | P4 | P5 | P3 |
------------------------------------------------------------------------------------
0 1 3 7 12 20
Round-Robin