Join Whatsapp Channel for Ignou latest updates JOIN NOW

Consider the following set of processes, with the length of the CPU burst time given in milliseconds. Process Burst time Priority P183P231P344P472P565 The processes are assumed to have arrived in the order P1, P2, P3, P4 and P5 andall of them have arrived at time 0. 1. Draw corresponding Gantt charts illustrating the execution of these processes using FCFS, SJF, SRTN, Priority based scheduling/even-driven scheduling and Round Robin (quantum=2) scheduling algorithms. 2. What is the turnaround time of each process for each of the scheduling algorithm in (a)? 3. What is the waiting time of each process for each of the scheduling algorithm in (a)? 4. Which of the schedules in (a) results in minimal average waiting time (overall processes)

Let’s tackle each scheduling algorithm one by one:

First-Come, First-Served (FCFS):

  • Gantt Chart:
| P1 | P2 | P3 | P4 | P5 |
  • Turnaround Time:
P1: 8 ms
P2: 11 ms
P3: 15 ms
P4: 22 ms
P5: 28 ms
  • Waiting Time:
P1: 0 ms
P2: 8 ms
P3: 11 ms
P4: 15 ms
P5: 22 ms

Shortest Job First (SJF):

  • Gantt Chart:
| P2 | P3 | P1 | P5 | P4 |
  • Turnaround Time:
P1: 12 ms
P2: 3 ms
P3: 7 ms
P4: 21 ms
P5: 9 ms
  • Waiting Time:
P1: 4 ms
P2: 0 ms
P3: 3 ms
P4: 14 ms
P5: 3 ms

Shortest Remaining Time Next (SRTN):

  • Gantt Chart:
| P2 | P3 | P1 | P1 | P1 | P1 | P1 | P5 | P5 | P5 | P5 | P5 | P4 | P4 | P4 | P4 |
  • Turnaround Time:
P1: 28 ms
P2: 3 ms
P3: 7 ms
P4: 21 ms
P5: 15 ms
  • Waiting Time:
P1: 20 ms
P2: 0 ms
P3: 3 ms
P4: 14 ms
P5: 9 ms

Priority-Based Scheduling:

  • Gantt Chart:
| P2 | P4 | P1 | P3 | P5 |
  • Turnaround Time:
P1: 19 ms
P2: 3 ms
P3: 11 ms
P4: 10 ms
P5: 14 ms
  • Waiting Time:
P1: 11 ms
P2: 0 ms
P3: 7 ms
P4: 3 ms
P5: 8 ms

Round Robin (Quantum = 2):

  • Gantt Chart:
| P1 | P2 | P3 | P4 | P5 | P1 | P4 | P5 | P1 | P5 | P1 |
  • Turnaround Time:
P1: 28 ms
P2: 14 ms
P3: 11 ms
P4: 20 ms
P5: 15 ms
  • Waiting Time:
P1: 20 ms
P2: 11 ms
P3: 7 ms
P4: 13 ms
P5: 9 ms

Conclusion:

The schedule with minimal average waiting time is Shortest Job First (SJF), as it has the shortest average waiting time among all the scheduling algorithms.

error: Content is protected !!