Five jobs arrive nearly simultaneously for processing and their estimated CPU cy
ID: 3679950 • Letter: F
Question
Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are, respectively: Job A = 12, Job B = 2, Job C = 15, Job D = 7, and Job E = 3 ms. a. Using FCFS, and assuming the difference in arrival time is negligible, in what order would they be processed? What is the total time required to process all five jobs? What is the average turnaround time for all five jobs? B) Using SJN, and assuming the difference in arrival time is negligible, in what order would they be processed? What is the total time required to process all five jobs? What is the average turnaround time for all five jobs?
Explanation / Answer
a)
In FCFS jobs are executed in the order of their arrival, therefore order of processing is,
A-B-C-D-E
As arrival time is 0,
The total time required to process all five jobs is,
(CPU time of A) + (CPU time of B)+ (CPU time of C) + (CPU time of D ) + (CPU time of E)
= 12 + 2 +15 + 7 + 3
Total time to process all five jobs = 39 ms
Turnaround time = finish time - arrival time
Turnaround tiime of A = 12-0 =12
Turnaround tiime of B = 14-0 = 14
Turnaround tiime of C = 29-0 = 29
Turnaround tiime of D = 36-0= 36
Turnaround tiime of E = 39-0 =39
Average turnaround time = (12+14+29+36+39)/5 = 26 ms
b)
In SJN or SJF, a job with shortest execution time is selected for execution.
In above problem the jobs are processed in order,
B-E-D-A-C
The total time required to process all five jobs is,
(CPU time of B) + (CPU time of E)+ (CPU time of D) + (CPU time of A ) + (CPU time of C)
= 2+3+7+12+15 = 39
Total time to process all five jobs = 39 ms
Turnaround time = finish time - arrival time
Turnaround tiime of B = 2-0 =2
Turnaround tiime of E = 5-0 = 5
Turnaround tiime of D = 12-0 = 12
Turnaround tiime of A = 24-0= 24
Turnaround tiime of C = 39-0 =39
Average turnaround time = (2+5+12+24+39)/5 = 16.4 ms
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.