Process Scheduling Algorithms
Process Scheduling Algorithms
The question is about process scheduling algorithms. We are given four processes (P1, P2, P3, P4)
with their arrival times (A.T), burst times (B.T), and priorities (Pn).
We need to determine the scheduling order using three different algorithms: First-Come,
First-Served (FCFS), Shortest Remaining Time First (SRTF), and Preemptive Priority.
|---|---|---|---|---|---|
| P1 | 0 | 7 | 7 | 7 | 0 |
| P2 | 3 | 5 | 12 | 9 | 4 |
| P3 | 3 | 3 | 15 | 12 | 9 |
| P4 | 5 | 5 | 20 | 15 | 10 |
SRTF schedules the process with the shortest remaining burst time. It's preemptive.
| 0-7 | P1 | 7 -> 0 |
| 7-10 | P2 | 5 -> 2 |
| 10-12 | P3 | 3 -> 0 |
| 12-15 | P2 | 2 -> 0 |
| 15-20 | P4 | 5 -> 0 |
|---|---|---|---|---|---|
| P1 | 0 | 7 | 7 | 7 | 0 |
| P2 | 3 | 5 | 12 | 9 | 4 |
| P3 | 3 | 3 | 12 | 9 | 6 |
| P4 | 5 | 5 | 20 | 15 | 10 |
This algorithm schedules the process with the highest priority (lowest Pn value). It's preemptive.
|---|---|---|
| 0-3 | P1 | 1 |
| 3-6 | P2 | 2 |
| 6-9 | P3 | 3 |
| 9-14 | P4 | 4 |
| 14-17 | P1 | 1 |
| 17-20 | P4 | 4 |
|---|---|---|---|---|---|
| P1 | 0 | 7 | 17 | 17 | 10 |
| P2 | 3 | 5 | 6 | 3 | 0 |
| P3 | 3 | 3 | 9 | 6 | 3 |
| P4 | 5 | 5 | 20 | 15 | 10 |
Final Answer