0% found this document useful (0 votes)
45 views3 pages

Process Scheduling: FCFS, SJF, RR

Uploaded by

thejasnaikrh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Process Scheduling: FCFS, SJF, RR

Uploaded by

thejasnaikrh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scheduling Algorithms with FCFS, SJF, and Round Robin

The problem involves scheduling processes (P1, P2, P3, P4) with their arrival

times (A.T) and burst times (B.T).

The questions are about calculating FCFS (First Come First Serve), SJF

(Shortest Job First), and Round Robin (RR) scheduling algorithms.

Step 1: Organize the Data

The processes and their details are:

| Process | Arrival Time (A.T) | Burst Time (B.T) |

|---------|--------------------|------------------|

| P1 |6 |9 |

| P2 |1 |4 |

| P3 |2 |9 |

| P4 |3 |5 |

---

Step 2: FCFS Scheduling

FCFS schedules processes in the order of their arrival.

| Process | A.T | B.T | CT | TAT | WT |

|---------|-----|-----|-----|-----|-----|

| P2 |1 |4 |5 |4 |0 |

| P3 | 2 | 9 | 14 | 12 | 3 |
| P4 | 3 | 5 | 19 | 16 | 11 |

| P1 | 6 | 9 | 28 | 22 | 13 |

Average Turnaround Time (TAT): 13.5

Average Waiting Time (WT): 6.75

---

Step 3: SJF Scheduling

SJF schedules the process with the shortest burst time first.

| Process | A.T | B.T | CT | TAT | WT |

|---------|-----|-----|-----|-----|-----|

| P2 |1 |4 |5 |4 |0 |

| P4 | 3 | 5 | 10 | 7 | 2 |

| P1 | 6 | 9 | 19 | 13 | 4 |

| P3 | 2 | 9 | 28 | 26 | 17 |

Average Turnaround Time (TAT): 12.5

Average Waiting Time (WT): 5.75

---

Step 4: Round Robin Scheduling (Quantum = 2)

Round Robin uses a time quantum of 2. The processes are executed as follows:

| Process | A.T | B.T | CT | TAT | WT |


|---------|-----|-----|-----|-----|-----|

| P2 | 1 | 4 | 11 | 10 | 6 |

| P3 | 2 | 9 | 28 | 26 | 17 |

| P4 | 3 | 5 | 21 | 18 | 13 |

| P1 | 6 | 9 | 29 | 23 | 14 |

Average Turnaround Time (TAT): 19.25

Average Waiting Time (WT): 12.5

---

Final Answer

1. FCFS Scheduling:

- Average Turnaround Time (TAT): 13.5

- Average Waiting Time (WT): 6.75

2. SJF Scheduling:

- Average Turnaround Time (TAT): 12.5

- Average Waiting Time (WT): 5.75

3. Round Robin Scheduling (Quantum = 2):

- Average Turnaround Time (TAT): 19.25

- Average Waiting Time (WT): 12.5

You might also like