Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two jobs, each needing 20 minutes of CPU time, start simultaneously. How long will the last one take to complete if they run sequentially? How long if they run in parallel? Assume 50% I/O wait.

Respuesta :

Answer:

If they run sequentially, time = 80 minutes after the start of job 1

If they run in parallel, time = 53.33 minutes

Explanation:

Data provided in the question:

CPU time needed for single job = 20 minutes

I/O wait = 50%

Now,

If they run sequentially

Total CPU time required for 2 jobs = 2 × 20 minutes = 40 minutes

For 50% I/O wait ,

the time required for 2 jobs = [tex]\frac{40}{50\%}[/tex] = 80 minutes

Hence,

The last job will take 80 minutes after the starting of the job 1

If they run in parallel

The approximate CPU utilization = 1 − 0. 5² = 1 - 0.25 = 0.75

For single job = [tex]\frac{0.75}{2}[/tex] = 0.375 CPU minute per minute of real time

Therefore,

For a job of 20 minutes, the time required = [tex]\frac{20}{0.375}[/tex]

= 53.33 minutes

RELAXING NOICE
Relax