What is the difference between preemptive and nonpreemptive scheduling?
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process | burst Time | Priority |
---|---|---|
P1 | 10 | 3 |
P2 | 1 | 1 |
P3 | 2 | 3 |
P4 | 1 | 4 |
P5 | 5 | 2 |
For each of the scheduling algorithms, FCFS, Shortest-Job-First (SJF, nonpreemptive), Priority (smaller priority number implies higher scheduling priority), and RR (quantum = 1) do the following.
Which of these scheduling algorithms gives the smallest average waiting time?
Suppose the following three processes arrive for execution at the arrival times indicated.
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 0.0 | 8 |
P2 | 0.4 | 4 |
P3 | 1.0 | 1 |
Note! You cannot schedule a process to execute before it has arrived!