67.4k views
3 votes
Three batch jobs, A through C, arrive at a high performance computer at the same time. They have estimated running times of 10, 6 and 2 minutes respectively. At time 3, jobs D and E arrive, which take 4 and 8 minutes respectively. For each of the following scheduling algorithms, determine the mean turnaround time. Ignore any process switching overhead.

a. First come, first serve
b. Shortest job first
c. Priority scheduling
For (a), assume that the system is multiprogrammed, and that each job gets its fair share of the CPU. For (b) and (c) assume that only one job runs at a time, until it finishes. All jobs are completely CPU bound.

User Clash
by
4.1k points

1 Answer

2 votes

Answer:

Check the explanation

Step-by-step explanation:

Hey, its a very good question to understand the scheduling algorithms. For simplicity purposes, I had divided the solution into parts. So, le's start.

Remember this formula:

TURNAROUND TIME = (TIME AT WHICH JOB COMPLETED - TIME OF ARRIVAL)

PART ONE: GIVEN DATA:

Process Execution Time Time Arrival

A 10 0

B 6 0

C 2 0

D 4 3

E 8 3

PART TWO: SOLUTION

1. FCFS:

Turnaround Time: The amount of time taken to complete a process from the time of arrival

Calculating the turnaround time of each process:

At t=0, 3 processes A, B and C arrived. Since priority is not given, so they can execute in any order.

At t=3, 2 Processes D and E arrived. Their priority is also not given, so they can also execute in any order.

However, for solving this part we will assume the execution lexicographically where the time of arrival is the same.

In FCFS they are pushed in Queue. So A, B, and C will execute first and then D and E will execute.

Turnaround time for :A = 10 (It executes first), B= 10+6=16 , C = 10+6+2 = 18

D = (18+4) - 3 = 19 (Since they arrived at t=3), E = (22 + 8) - 3 = 27

Mean Turnaround Time = Total Turnaround time / N

= (10 + 16 + 18 + 19 + 27)/5

= 90/5

= 18

1. SJB(Shortest Job First):

At t=0, A,B and C all arrived together. now the job having shortest execution time will be executed.

C will execute first.

Turnaround time for: C = (2-0), (0 to 2) = 2

B= 12 - 0 = 12

D = 7 - 3 = 4

E = 20 -3 = 17

A = 30 - 0 = 30

Mean turnaround time = (2 + 12 + 4 + 17 + 30)/5

= 65/5

= 13

User Newyuppie
by
4.2k points