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

Five batch jobs A through E, arrive at a computer center at almost the same time

ID: 3724322 • Letter: F

Question

Five batch jobs A through E, arrive at a computer center at almost the same time. They have estimated running times of 10, 9, 2, 5, and 3 minutes. Their externally determined priorities are 3, 5, 2, 1, and 4 respectively, with 5 being the highest priority. For each of the following scheduling algorithm, determine the mean process turnaround time. Ignore process switching overhead time.

Round-Robin with quantum of 5                                                                            

Priority Scheduling                                                                                                

First-Come, First Serve (run in order 10, 9, 2, 5, 3)                                               

Shortest Job First

Explanation / Answer

In round robin scheduling each of the jobs gets a equal fare share on the CPU Time. Initially all five are running so each of them will get 1/5 =0.2 CPU time. After 10 min, A had 8 mins left, B had 4, D had 2 and E will have 6. Since there are now 4 jobs they will each get 1/4 the CPU time, which means they will take four times as long to run. So, it will take 8 mins for D to complete, so D took 10 + 8 = 18 min. Now, A will have 6 mins left, B 2, and E 4. Each process gets 1/3rd of the CPU. Hence B will complete execution in 6 minutes. (B took 10 + 8+ 6= 24 mins). Now A will have 4 mins and E 2mins left. Each process gets 1/2 of the CPU, so E will finish executing in 4 mins. (E took 24 + 4= 28 mins) Since A has only 2 mins left to run and it is the only job on the CPU, it will finish in to minutes with a total time of (28 + 2 )=30 mins. Averaging we get (10+18+24+28+30)/5 = 22 mins average turnaround.

Each job runs to completion without being preempted. Since B has the highest priority it will run first, followed by E, followed by A, followed by C and finally D. There is no preemption, so B completes after 6 mins, E after 6 mins of waiting for B and 8 mins of processing (14 mins total), A after 14 mins of waiting for B and E, and 10 mins processing (24 mins total), C after 24 mins of waiting for B,E and A, and 2 mins processing (26 mins total)and D after 26 mins of waiting for B,E,A & C and 4 mins of processing (30 mins total). The average is (6+14+24+26+30)/5 = 100/5 = 20.

Processes run to completion in the order of arrival. A completes after 10 mins, B completes after (10 +6)=16 mins, C completes after (16 + 2)=18 mins, D completes after (18+4)=22 mins, and E completes after (22+8)=30 mins. The average is : (10+16+18+22+30)/5 = 96/5 = 19.2

Processes will run to completion in the order : C, D, B, E, A C completes after 2 mins, D completes after (2+4)=6 mins, B completes after (6+6)=12 mins, E completes after (12+8)=20 mins, and A completes after (20+10)=30 mins. The average is : (2+6+12+20+30)/5 = 70/5 = 14 mins