Table 1shows that there are four jobs in the queue. Job 1 arrived first, and 4 l
ID: 3752833 • Letter: T
Question
Table 1shows that there are four jobs in the queue. Job 1 arrived first, and 4 last. Their priority is given in shown in the middle column (1 is the lowest and 4 is highest), and CPU tine is shown in right column For the following- questions, please fill the blanks (time unit msec) 1) Using first-come first-serve scheduling algorithm, 1. Table 1 Job # 1 Priority | CPU time turnaround time for Job 1is turnaround time for Job 2 is: turnaround time for Job 3 is: turnaround time for Job 4 is: average turmaround time is: 3 150 2 250 3 350 450 2) Using shortest-job-first scheduling algorithm turnaround time for Job 1 is turnaround time for Job 2 is: turnaround time for Job 3 is: turnaround time for Job 4 is: average turnaround time is Using priority scheduling algorithm, 3) turnaround time for Job 1 is turnaround time for Job 2 is: turnaround time for Job 3 is: turnaround time for Job 4 is average turnaround time is: Using round-robin scheduling algorithm, 4) turnaround time for Job 1 is turnaround time for Job 2 isExplanation / Answer
As the arrival times of jobs are not given, so assuming that all the jobs arrived at 0 ms but in the order 1,2,3,4. So, the turnaround time for the job becomes their completion time as arrival times are 0.
(a) In FCFS, the job which arrives first is executed first. So, job 1 is executed first and job 4 last.
Job 1 starts executing at time 0 and ends at 150 ms(its CPU time).
So, turnaround time for job 1 is same as its CPU time, i.e , 150 ms.
Then job 2 starts its execution at 150 ms and then ends at (150 + 250) ms = 400ms.
So, turnaround time for job 2 = 400 ms.
Then job 3 starts its execution at 400 ms and then ends at (400 + 350) ms = 750ms.
So, turnaround time for job 3 = 750 ms.
Then job 4 starts its execution at 750 ms and then ends at (750 + 450) ms = 1200ms.
So, turnaround time for job 4 = 1200 ms.
So, average turnaround time = (150+400+750+1200)/4.
average turnaround time in FCFS = 625 ms.
(b) In shortest job first algorithm, the job with the shortest CPU time is executed first. So, the jobs are executed in the same order as FCFS as they are already arranged according to their CPU times. Therefore the turnaround times for individual jobs and the average turnaround time are also same as the (a) part.
(c) In priority scheduling algorithm, the job with the highest priority is executed first, followed by jobs with decreasing priority. So, the job 2 is executed first, then 1, 4 and 3.
Job 2 starts executing at time 0 and ends at 250 ms(its CPU time).
So, turnaround time for job 2 is same as its CPU time, i.e , 250 ms.
Then job 1 starts its execution at 250 ms and then ends at (150 + 250) ms = 400ms.
So, turnaround time for job 1 = 400 ms.
Then job 4 starts its execution at 400 ms and then ends at (400 + 450) ms = 850ms.
So, turnaround time for job 4 = 850 ms.
Then job 4 starts its execution at 850 ms and then ends at (850 + 350) ms = 1200ms.
So, turnaround time for job 3 = 1200 ms.
average turnaround time = (250 + 400 + 850 + 1200)/4
average turnaround time = 675 ms
(d) As the time slice for the round robin algorithm is not given, the algorithm cannot be implemented.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.