Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Five jobs arrive nearly simultaneously for processing and their estimated CPU cy

ID: 3589162 • Letter: F

Question

Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are, respectively: Job A = 2 ms, Job B = 12 ms, Job C = 15 ms, Job D = 7 ms, and Job E = 3 ms.

a. Using FCFS, 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 each of these five jobs?

b. Using SJN, and assuming that all jobs are present when the algorithm begins, 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?

c. Using SJN, and assuming that all jobs are present when the algorithm begins, what is the average turnaround time for all five jobs using these speeds: Job A = 12 ms, Job B = 2 ms, Job C = 15 ms, Job D = 7 ms, and Job E = 3 ms.

Explanation / Answer

a)

Using FCFS jobs are executed in order of their arrival, therefore order of processing is,A-B-C-D-E , and the arrival time is 0,

Total time to process all five jobs = 39 ms

Turnaround time = finish time - arrival time

Turnaround time of A = 2-0 =2

Turnaround time of B = 14-0 = 14

Turnaround time of C = 29-0 = 29

Turnaround time of D = 36-0= 36

Turnaround time of E = 39-0 =39

Average turnaround time = (2+14+29+36+39)/5 = 24 ms

b)

In SJN, a job with shortest execution time is selected for execution.

The jobs are processed in order,A-E-D-B-C

The total time required to process all five jobs is,

Total time to process all five jobs = 39 ms

Turn around time = finish time - arrival time

Turn around time of A = 2-0 =2

Turn around time of E = 5-0 = 5

Turn around time of D = 12-0 = 12

Turn around time of B = 24-0= 24

Turn around time of C = 39-0 =39

Average turn around time = (2+5+12+24+39)/5 = 16.4 ms

c)

With given time only time duration of A and B are interchanged so only order will be changed which will be B-E-D-A-C

The total time required to process all five jobs is,

Total time to process all five jobs = 39 ms

Turn around time = finish time - arrival time

Turn around time of B = 2-0 =2

Turn around time of E = 5-0 = 5

Turn around time of D = 12-0 = 12

Turn around time of A = 24-0= 24

Turn around time of C = 39-0 =39

Average turn around time = (2+5+12+24+39)/5 = 16.4 ms

So times will remain same.