Operating Systems | Scheduling Algorithms : LJF
Longest Job First
This algorithm schedules process with longest burst time. The scheduling can be either preemptive or non-preemptive.
Example: Find the completion time, turn around time, waiting time and response time of given set of processes in the following table?
- Use Longest First Algorithm.
- No preemption
- No I/O request will be there from any process
- Arrival time is relative to CPU on time
| Process Number | AT | BT |
|---|---|---|
| 1 | 0 | 3 |
| 2 | 1 | 3 |
| 3 | 2 | 4 |
| 4 | 2 | 1 |
Solution :
The time analytics of above processes can be depicted as shown below
By analyzing above representation completion time, turn around time and waiting time can be calculated as given below.
| Process Number | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| 1 | 0 | 3 | 3 | 3 | 0 |
| 2 | 1 | 3 | 10 | 9 | 6 |
| 3 | 2 | 4 | 7 | 5 | 1 |
| 4 | 2 | 1 | 11 | 9 | 8 |
Comments
Post a Comment