Dale - Computer Science Illuminated 366

Dale - Computer Science Illuminated 366 - Summary 339...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Summary 339 p1 p2 p3 p4 p5 p2 p3 p4 p5 p1 p3 p4 p3 p4 p3 p4 p3 p 3 p 4 p 5 p1 0 50 325 515 640 920 940 Suppose the time slice used for a particular round-robin scheduling algorithm was 50 and we used the same set of processes as our previous examples. The Gantt chart results are: Each process is given a time slice of 50, unless it doesn’t need a full slice. For example, process 2 originally needed 75 time units. It was given an initial time slice of 50. When its turn to use the CPU came around again, it needed only 25. Therefore, process 2 terminates and gives up the CPU at time 325. The average turnaround time for this example is (515 + 325 + 940 + 920 + 640) / 5, or 668. Note that this turnaround time is higher than in the other examples. Does that mean the round-robin algorithm is not as good as the others? No. We can’t make such general claims based on one example. We can only say that one algorithm is better than another for that specific set of processes. General analysis of algorithm efficiencies is much more involved.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online