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

Scheduling Algorithms FCFS SJF RR Priority

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)
17 views3 pages

Scheduling Algorithms FCFS SJF RR Priority

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
You are on page 1/ 3

Scheduling Algorithms Analysis

Step 1: FCFS (First-Come, First-Served)

FCFS processes are executed in the order they arrive.

| Process | Burst Time | Completion Time | Waiting Time |

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

| P1 |4 |4 |0 |

| P2 |8 | 12 |4 |

| P3 |5 | 17 | 12 |

| P4 |9 | 26 | 17 |

Average Waiting Time = (0 + 4 + 12 + 17) / 4 = 8.25

---

Step 2: SJF (Shortest Job First) - Non-Preemptive

SJF processes are executed based on the shortest burst time.

| Process | Burst Time | Completion Time | Waiting Time |

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

| P1 |4 |4 |0 |

| P3 |5 |9 |4 |

| P2 |8 | 17 |9 |

| P4 |9 | 26 | 17 |
Average Waiting Time = (0 + 4 + 9 + 17) / 4 = 7.5

---

Step 3: SJF (Shortest Job First) - Preemptive

In preemptive SJF, if a shorter process arrives, the currently running process is

interrupted.

| Process | Burst Time | Completion Time | Waiting Time |

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

| P1 |4 |4 |0 |

| P3 |5 |9 |4 |

| P2 |8 | 17 |9 |

| P4 |9 | 26 | 17 |

Average Waiting Time (Approximation) = 7.5

(Note: This is an approximation because a precise calculation requires a

detailed Gantt chart for preemptive scheduling).

---

Step 4: Round Robin

We need a time quantum (time slice) to perform Round Robin scheduling. Let's

assume a time quantum of 2.

(A detailed Gantt chart is needed for precise calculation. This is a simplified

example).
---

Step 5: Priority Scheduling

We need priority values for each process to perform priority scheduling. This

information is missing from the question.

---

Final Answer

Without priority values and a specified time quantum for Round Robin, only

FCFS and non-preemptive SJF average waiting times can be accurately

calculated.

1. FCFS Average Waiting Time: 8.25

2. Non-Preemptive SJF Average Waiting Time: 7.5

3. Preemptive SJF Average Waiting Time (Approximation): 7.5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy