Solve these Unsolved Questions on CPU Scheduling Algorithms to check out your understanding on the same

Q1. Find the av. waiting time and av. turnaround time using:

a) FCFS

b) SJF(NP)

c) SJF(P)

d) RR (TQ=3)

Process | Burst Time | Arrival Time |

P1 | 2 | 2 |

P2 | 6 | 5 |

P3 | 4 | 0 |

P4 | 7 | 0 |

P5 | 4 | 7 |

Q2. Find the av. waiting time and av. turnaround time using:

a) SJF(NP)

b) SJF(P)

PROCESS | BURST TIME | ARRIVAL TIME |

P1 | 3 | 2 |

P2 | 5 | 0 |

P3 | 3 | 1 |

P4 | 4 | 6 |

Q3. Find the av. waiting time and av. turnaround time using:

a) Priority(NP)

b) Priority(P)

PROCESS | BURST TIME | ARRIVAL TIME | Priority |

P1 | 3 | 2 | 1 |

P2 | 5 | 0 | 3 |

P3 | 3 | 1 | 2 |

P4 | 4 | 6 | 1 |

Q1. [GATE-2006] Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.

(a) 1 (b) 2 (c) 3 (d) 4

Q2. [GATE-2006] Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:

(a) 13 units (b) 14 units (c) 15 units (d) 16 units

Q3. [GATE-2007] An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:

Process Execution time Arrival time P1 20 0 P2 25 15 P3 10 30 P4 15 45

What is the total waiting time for process P2?

(a) 5 (b) 15 (c) 40 (d) 55

Q1) a) FCFS: Avg WT- 6.6

b)SJF(NP): Avg WT- 4.8

Q2) a) SJF(NP):Avg WT- 3.75

Wow thank you for your generous contribution

Well Done. Share answers for other questions also

Q1) a) SJF(NP): AVG W.T-4.8

correct..solve others also

Q2) B

AWT = 3.25

Q2:ANSWER:

a) SJF(NP)

AWT=3.75

b)SJF(P)

AWT=3.25

Great

Q1 ANSWER:

a) FCFS AWT=6.6

b)SJF(NP) AWT =4.8

c)SJF(P) AWT=5.2

(a) and (b) are correct. For (c) it should be 4.6. Check again

for c …..i am not getting.Can you please explain

Q2. b) SJF(P): Avg WT: 3.25

Q2

a) SJF(NP)

AWT=3.75

b)SJF(P)

AWT=3.25

Q3) 1

AWT = 4.25

wrong.

Q3

A — AWT = 4

B — AWt = 4.2

B:4.25

Q3:

A)(NP) AWT=4;

ATAT=7.75

B)(P) AWT=3.5

ATAT=7.25

A is correct. for B it should be 4.25(AV. Waiting) and 8 (TAT)

Q3. a) Priority(NP) : Avg WT: 4

correct..calculate for other also

3 que avg waiting 4.7 and avg turnaround time is 8.5

A) Av. Wait: 4 and TAT: 7.75

B) Av. Wait: 4.25 and TAT: 8

Q3:-

A)AWT(Np)=4;

ATAT=7.75

B) AWT(P)=3.5

ATAT=7.25

A) Av. Wait: 4 and TAT: 7.75

B) Av. Wait: 4.25 and TAT: 8