Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a system with five processes. All five processes start executing at the

ID: 667691 • Letter: C

Question

Consider a system with five processes. All five processes start executing at the same time (time 0). The first process will run for 5 seconds; the second, 8 seconds; the third, 4 seconds; the fourth, 10 seconds; and the fifth, 2 seconds. Create a log showing time (start with time, t0) and each state transition (e.g., P2: New to Ready) as the system executes the 5 processes using a first-come-first-serve scheduling algorithm. Repeat the exercise for the round robin (assume a quantum time of 2 seconds) and shortest job first scheduling algorithms.

Explanation / Answer

first-come-first-serve scheduling algorithm

Process 1 will start at time t0 and finish at t0+5 seconds.
Process 2 will start at time t0+5 seconds and finish at t0+13 seconds.
Process 3 will start at time t0+13 seconds and finish at t0+17 seconds.
Process 4 will start at time t0+17 seconds and finish at t0+27 seconds.
Process 5 will start at time t0+27 seconds and finish at t0+29 seconds.


shortest job first scheduling algorithms.

Order of scheduling jobs are :- 5th process, 3rd process, 1st process, 2nd process and 4th process.
Process 5 will start at time t0 and finish at t0+2 seconds.
Process 3 will start at time t0+2 seconds and finish at t0+6 seconds.
Process 1 will start at time t0+6 seconds and finish at t0+11 seconds.
Process 2 will start at time t0+11 seconds and finish at t0+19 seconds.
Process 4 will start at time t0+19 seconds and finish at t0+29 seconds.

Round robin (assume a quantum time of 2 seconds)

Since quantam time is 2 sec it means a process will start scheduling, it will scheduled for only 2 min in one round and next 2 min of it in next round and so on until it is not fully completed.

Round 1 :- For time t0 to t0+2 sec process 1 will schedule, t0+2 to t0+4 process 2 will schedule, t0+4 to t0+6 process 3 will schedule, t0+6 to t0+8 process 4 will schedule, t0+8 to t0+10 process 5 will schedule. Since process 5 completes it in 2 second it will not schedule in next round.

Round 2 :- For time t0+10 to t0+12 sec process 1 will schedule, t0+12 to t0+14 process 2 will schedule, t0+14 to t0+16 process 3 will schedule, t0+16 to t0+18 process 4 will schedule. After this round process 3 completed.

Round 3 :- For time t0+18 to t0+19 sec process 1 will schedule (Becuase 1 min of process was left), t0+19 to t0+21 process 2 will schedule, t0+21 to t0+23 process 4 will schedule


Round 4 :- For time t0+23 to t0+25 sec process 2 will schedule, For time t0+25 to t0+27 sec process 4 will schedule. (Process 2 is also completed by this round)

Round 5 :- For time t0+27 to t0+29 sec process 4 will schedule.