112k views
5 votes
Five batch jobs. A through E, arrive at a computer center at almost the same time. They have estimated running times of 10, 6, 2, 4, and 8 minutes. For each of the following scheduling algorithms, determine the average process turnaround time. Ignore process switching overhead. Note that all jobs are completely CPU bound. Assumption: The processes are added to the ready queue in this order: run in order A, B, C, D, E.

User Bonita
by
6.3k points

1 Answer

3 votes

Answer:

a) Round Robin = 21.2 minutes

(b) First -come, First Serve = 19.2 minutes

(c) Shortest job first = 14 minutes

Step-by-step explanation:

The five job have a time of 10, 6, 2, 4, and 8.

The question doesn't specify the scheduling algorithm, so we will solve for round Robin scheduling algorithm, First Come First Serve and shortest job first scheduling algorithm.

Shortest job first scheduling algorithm execute the job that has the shortest completion time first.

First Come First Serve scheduling algorithm execute the job based on order of arrival.

Round Robin scheduling algorithm execute job based on a given time slice. If the time given is finish and the job hasn't finished, the job is removed and put on the queue while another job enter for execution.

Turnaround time = Completion time - Arrival time

In this case; our arrival time is 0; so turnaround time = completion time.

(a) Round Robin: We were not given quantum time, so we assume quantum time of 1. The sequence of execution will be:

A B C D E | A B C D E | A B D E | A B D E | A B E | A B E | A E | A E | A | A

Average Turnaroud time =

((30-0) + (23-0) + (8-0) + (17-0) + (28-0))/5 = 106/5 = 21.2 minutes

(b) First -come, first served (run in order 10, 6, 2, 4, 8):

A B C D E = ((10-0) + (16-0) + (18-0) + (22-0) + (30-0))/5 = 96/5 = 19.2 minutes

(c) Shortest job first:

C D B E A = ((2-0) + (6-0) + (12-0) + (20-0) + (30-0))/5 = 70/5 = 14 minutes

User Dave Keane
by
7.5k points