exercise (5). exercise assume the following jobs are executed with one processor, with the jobs...

5
Exercise (5)

Upload: gilbert-beasley

Post on 19-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Exercise (5). Exercise Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a

Exercise (5)

Page 2: Exercise (5). Exercise Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a

Exercise

• Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a system uses RR scheduling with a quantum of

15. Create a Gantt chart illustrating these processes.

– What is the turnaround time for process p3?

– What is the average waiting time for processes?

2

i (pi)

0 80

1 20

2 10

3 20

4 50

Page 3: Exercise (5). Exercise Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a

3

p1 p2 p3

Avg. waiting time of RR is:

i (pi)

0 80

1 20

2 10

3 20

4 50

p0

p4

0

0

FCFS:

SJN:

Turnaround time of process p3 with RR :

Page 4: Exercise (5). Exercise Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a

Exercise• Assume the following jobs are executed with one

processor, with the job arriving time listed in the table. – Suppose a system uses preemptive SJN scheduling. Create

a Gantt chart illustrating these processes.

– What is the turnaround time for process p3?

– What is the average waiting time for processes?

4

i (pi) Arrival time

0 80 0

1 20 10

2 10 30

3 20 35

4 50 40

Page 5: Exercise (5). Exercise Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table. – Suppose a

5

p1 p2

p3

Avg. waiting time of preemptive SJN is:

p0

p4

0

0

FCFS:

SJN:

Turnaround time of process p3 with preemptive SJN:

i (pi) Arrival time

0 80 0

1 20 10

2 10 30

3 20 35

4 50 40