Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below
Process Priority | Arrival Time (in ms) | CPU Time Needed (in ms) | Priority |
P1 | 0 | 10 | 5 |
P2 | 0 | 5 | 2 |
P3 | 2 | 3 | 1 |
P4 | 5 | 20 | 4 |
P5 | 10 | 2 | 3 |
smaller the number, higher the priority.
If the CPU scheduling policy is SJF with pre-emption, the average waiting time will be
A. | 8 ms |
B. | 14 ms |
C. | 6 ms |
D. | none of these |
Option: C Explanation : Scheduling order will be
P2 , P3 , P1 , P5 , P1, P4
Click on Discuss to view users comments. Preeti Sharma said: (1:40am on Saturday 26th May 2018)
waiting time fpr p1=10,p2=3,p3=0,p4=15,p5=0average waiting time=(10 3 0 15 0)/5= 28/5 =5.6ms
|
Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below
Process Priority | Arrival Time (in ms) | CPU Time Needed (in ms) | Priority |
P1 | 0 | 10 | 5 |
P2 | 0 | 5 | 2 |
P3 | 2 | 3 | 1 |
P4 | 5 | 20 | 4 |
P5 | 10 | 2 | 3 |
smaller the number, higher the priority.
If the CPU scheduling policy is priority scheduling without pre-emption, the average waiting time will be
A. | 12.8 ms |
B. | 11.8 ms |
C. | 10.8 ms |
D. | none of these |
Option: C Explanation : 30 + 0 + 3 + 3 + 18 divided by 5, i.e. 10.8 ms. Click on Discuss to view users comments. Rnns said: (1:03am on Monday 30th October 2017)
Its 11.8 sec because it is non preemptive... So once process is started then it will complete before starting another process... Waiting time of p1 to p5 it is 37, 0, 3, 2, 17.. Total= 59, average= 59/5 = 11.8
|
Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below
Process Priority | Arrival Time (in ms) | CPU Time Needed (in ms) | Priority |
P1 | 0 | 10 | 5 |
P2 | 0 | 5 | 2 |
P3 | 2 | 3 | 1 |
P4 | 5 | 20 | 4 |
P5 | 10 | 2 | 3 |
smaller the number, higher the priority.
If the CPU scheduling policy is priority sche duling with pre-emption, the average waiting time will be
A. | 19 ms |
B. | 7.6 ms |
C. | 6.8 ms |
D. | none of these |
Option: B Explanation : Here the process which will start at the initial millisecond will be P2 as it has more priority that P1. ms Process 0 to 2 P2 (P2 completed 2 ms here) 2 to 5 P3 (No wait for P3) 5 to 8 P2 (P2 had to wait 3 ms to get executed ) 8 to 10 P4 (P4 had to wait 3 ms to get started) 10 to 12 P5 (No wait for P5) 12 to 30 P4 (P4 had to wait 2 ms to complete its remaining) 30 to 40 P1 (Was waiting for 30 ms) So, waiting time---- P1 -30 P2 -3 P3 -0 P4 -5 P5 -0 Average---- (30+3+0+5+0)/5= 7.6 ms . Click on Discuss to view users comments. |
Syllabus covered in this section is-
This Section covers Operating System Questions Answers .These questions can be used for the preparation of various competitive and academic exams like
Who can benefit
Various search terms used for This section are