170k views
2 votes
Five batch jobs A through E arrive at a computer center in the order A to E at almost the same time. They have estimated running times of 6, 4, 1, 3, and 7 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 algorithms, determine the mean process waiting time. Ignore process switching overhead.

a) Round Robin ( assume quantum = 1 )
b) Priority scheduling
c) First-come first-served
d) Shortest job first
For a), assume that the system is multitasking, and that each job gets its fair share of the CPU. For b) through d) assume that only one job at a time runs, until it finishes. All jobs are completely CPU bound.

User Roza
by
4.7k points

1 Answer

5 votes

Answer:

Step-by-step explanation:

The Turnaround time is the amount of time that elapses between the job arriving and completing. We assume that all jobs arrive at time 0, the turnaround time will simply be the time that they complete.

Round Robin:

we assume that the time quantum of the scheduler is 1 second.The table below gives a break down of which jobs will be processed during each time quantum. A asterisk(*) indicates that the job completes during that quantum.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

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

C* = 8

D*=17

B*=23

E*=28

AVERAGE TURNAROUND = (8+17+23+28+30)/5 =106/5 = 21.2 MINUTES

B) PRIORITY SCHEDULING:

1-6 7-14 15-24 25-26 27-30

B E A C D

AVERAGETURNAROUND =(6+14+24+26+30)/5 = 100/5 = 20 MINUTES.

C)FCFS

1-10 11-16 17-18 19-22 23-30

A B C D E

AVERAGE TURNAROUND =(10+16+18+22+30)/5 = 96/5=19.2 MINTUES

D)SJF

1-2 3-6 7-12 13-20 21-30

C D B E A

AVERAGE TURNAROUND - (2+6+12+20+30)/5 =70/5 =14 MINUTES.

User Meetnick
by
5.8k points