2. Three jobs are in the queue. The number of tickets each has and the number of
ID: 3752796 • Letter: 2
Question
2. Three jobs are in the queue. The number of tickets each has and the number of seconds of processing time each requires are shown in Table 2. Assume that quanta of CPU time are sufficiently small, and that no other processes get any tickets before the last of these processes complete. For the following questions, please circle the correct answer from the candidate list. Using lottery scheduling algorithm, Table 2 turnaround time for Job 1 is turnaround time for Job 2 is turnaround time for Job 3 is: average turnaround time is: Job #| Tickets | CPU time 1 30 10 3015 40 10Explanation / Answer
Solution:-
/* Please Upvote*/
Turnaround Time = Completion time - Arival time
Here arival time is 0.
Average Turnaround Time
=(30+35+25)/3
=30
Explaination:-
We have three jobs 1,2 and 3. job 1 has 30 tickets(ticket number 1 to 30) , job 2 have 30 tickets
(ticket no. 31 to 60) and job 3 have 40 tickets (ticket no. 61 to 100).
Scheduler picks a random number from 1 to 100.If the picked no. is from 1 to 30 then job 1 is executed or if the picked no. is from 31 to 60 then job 2 is executed otherwise job 3 is executed.
Job 3 will be completed after 25 seconds.
because 25*(40/100)=10.
So after 25 seconds CPU time left for each jobs are
For job 1:
25*(30/100)=7.5 seconds has completed.
10-7.5=2.5 seconds left.
For job 2:
25*(30/100)=7.5 seconds has completed.
15-7.5=7.5 seconds left.
Now there are only two jobs 1 and 2.
After 5 more seconds job 1 wiil be completed.
So after 30 seconds CPU time left job 2 is
7.5 + 2.5=10 seconds has completed.
15-10=5 seconds left.
So there is only one job left.
After 5 more seconds job 2 wiil be completed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.