Question: Part II: Process Scheduling Consider the following 4 source codes: Source Code 1: program My_Pgm1 i = 1 for n = 1 to 10 x
Part II: Process Scheduling
Consider the following 4 source codes:
Source Code 1:
program My_Pgm1
i = 1
for n = 1 to 10
x = i + n
next
end
Source Code 2:
program My_Pgm2
i = 10
for n = 1 to 8
x = i + n
next
end
Source Code 3:
program My_Pgm3
i = 10
for n = 1 to 15
x = i + n
next
end
Source Code 4:
program My_Pgm4
i = 10
for n = 1 to 5
x = i - n
next
end
Create 4 processes P1, P2. P3 and P4 from source codes 1, 2, 3and 4 respectively with following properties. Fill up the following table by considering Log data only:
| Scheduling Algorithm: FCFS | ||||
| Process | Arrival Time |
| Waiting time | |
| P1 | 0 |
|
| |
| P2 | 0 |
|
| |
| P3 | 0 |
|
| |
| P4 | 0 |
|
| |
| Average waiting time: |
|
| ||
| Scheduling Algorithm: Round Robin with time quantum 5 | ||||
| Process | Arrival Time |
| Waiting time | |
| P1 | 0 |
|
| |
| P2 | 0 |
|
| |
| P3 | 0 |
|
| |
| P4 | 0 |
|
| |
| Average waiting time: |
|
| ||
| Scheduling Algorithm: Shortest Job First (Pre-emptive) | ||||
| Process | Arrival Time | Priority | Waiting time | |
| P1 | 0 | 1 |
| |
| P2 | 2 | 2 |
| |
| P3 | 6 | 1 |
| |
| P4 | 4 | 2 |
| |
| Average waiting time |
|
| ||
| Scheduling Algorithm: Shortest Job First (Non-Pre-emptive) | ||||
| Process | Arrival Time | Priority | Waiting time | |
| P1 | 0 | 1 |
| |
| P2 | 2 | 2 |
| |
| P3 | 6 | 3 |
| |
| P4 | 4 | 4 |
| |
| Average waiting time: | ||||
| Out of three cases, which one is better and why?
| ||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
