edited by
2,794 views
1 votes
1 votes

Common data

Consider the foloowing 4 processes that arrive at time 0 with the length of CPU burst time given as follows

PROCESS| BURST TIME

P1                     5

P2                     8

P3                     3

P4                     5

QUS1.  If Ʈis 10 and the parameter that controls the relative weight of recent and past history (α)=0.5, then what is the expected burst time of process P5 if it is SJF scheduling?

a)5.1875

b)4.8132

c)5.625

d) none of these

QUS 2. if the parameter that controls the relative weight of recent and past history is unity, then what is the expected burst time of process P5?

)4

b)3

c)5

d)4.5

edited by

2 Answers

3 votes
3 votes
Ans of first Ques. is a

as  T2=0.5*5 + (1-0.5)10=7.5

       T3=0.5*8+0.5*T2

        T4=0.53+0.5*T3=5.375

T5=5.1875

explanation :here we have to assume what will be the next burst time from available data so process given burst time in question  is hidden to us . and by applying aging formula we have to measure the respective burst time .

and yes ans of second question is c as alpha is 1 so T5=t4.
0 votes
0 votes

#ANS1.  (D) none of these

u took P2 twice in the quesn i am considering 
 

P1                     5

P2                     8

P3                     3

P4                     5


Since  it is SJF scheduling . the process will execute in following manner
p3->p1->p4->p2

so this is the problem of exponential avearge or it is also called 'Aging" problem.

Ʈ1= 10
so according to the formula of exponential average,
Ʈn=α*tn-1 +(1-α)Ʈn-1  where tn-1 = process burst time
Since  it is SJF scheduling . the process will execute in following manner
p3->p1->p4->p2
so the burst time will be available in following manner
t1=3,t2=5,t3=5,t4=8


Ʈ2= (0.5)*3 + (1-0.5)10     [t1=3  because  1st p3 will execute and its burst time =3(given) ]
Ʈ2=6.5
similarly

Ʈ3=0.5*5+(0.5*6.5)
Since  it is SJF scheduling . the process will execute in following manner
Ʈ3=5.75
similarly

Ʈ4=5.75
Ʈ4=5.375
Ʈ5=  6.6875
it doesnt match any options so D should be the right choice.
FOR ans 2 
alpha is 1

when α=1, then Ʈn=tn-1 

So, Ʈ5= t4=8....... 

because If alpha is 1.0, then past history is ignored, and we assume the next burst will be the same length as the last burst.  so the options are wrong and answer should be 8.

edited by

Related questions

223
views
1 answers
0 votes
arpit.jha asked Apr 26
223 views
Hi, All I have a question that in Process Scheduling topic most of the time we need to solve the problem using Gantt chart that's a bit time ... there any faster way to get solutions . Please provide any resource if available.Thanks
556
views
1 answers
0 votes
Nam14 asked Apr 5, 2023
556 views
Please read below passage from 10th edition Operating System Concepts, pg. 202:5.1.3 Preemptive and Nonpreemptive SchedulingCPU-scheduling decisions may take place ... choice for CPU-scheduling decisions to not take place for situation 3?
709
views
3 answers
0 votes
Chaitanya Kale asked Sep 22, 2022
709 views
If we are using non-preemptive CPU scheduling then can there be process state transition from running to ready state?