Algorithm evaluation byu cs 345 scheduling 39

This preview shows page 38 - 48 out of 93 pages.

Algorithm Evaluation
Image of page 38

Subscribe to view the full document.

BYU CS 345 Scheduling 39 Deterministic Modeling Advantages Simple Fast Exact Results Disadvantages too specific too much exact knowledge is required tied to example data Algorithm Evaluation
Image of page 39
BYU CS 345 Scheduling 40 Queuing Theory Using statistics, we can determine the distribution of CPU and I/O bursts. Probability distribution function The result is a mathematical formula which describes the probability of a particular burst Mathematics can then tell us performance A computer system can be described as a network of servers each server has a queue of waiting processes Simply add an imaginary server to each queue. Now, we can compute statistics Queuing Theory
Image of page 40

Subscribe to view the full document.

BYU CS 345 Scheduling 41 UNIX Scheduling Priorities are recomputed once per second Base priority divides all processes into fixed bands of priority levels Nice adjustment factor used to keep process in its assigned band Other Algorithms
Image of page 41
BYU CS 345 Scheduling 42 Unix System V Scheduling Multilevel feedback (Fair-share scheduling), with RR within each priority queue 10ms second preemption priority based on process type and execution history, lower value is higher priority Priority recomputed once per second, and scheduler selects new process to run For process j, P j (i) = Base + CPU(i-1)/2 + nice P j (i) is priority of process j at interval i Base is base priority of process j CPU(i) = U(i)/2 + CPU(i-1)/2 U(i) is CPU use of process j in interval i exponentially weighted average CPU use through interval i nice is user-controllable adjustment factor Restrictions placed on CPU and nice to prevent a process from getting too far away from its base priority band Performance Comparisons
Image of page 42

Subscribe to view the full document.

BYU CS 345 Scheduling 43 Guaranteed Scheduling Guaranteed Scheduling P 0 P 2 P 3 P 4 T c = 0 T u = 4 Current time is 13 T c = 2 T u = 1 T c = 2 T u = 2 T c = 4 T u = 6 T e = 13 / 4 = 3.25 T e = 11 / 4 = 2.75 T e = 11 / 4 = 2.75 T e = 9 / 4 = 2.25 P = 4 / 3.25 = 1.23 P = 1 / 2.75 = 0.36 P = 2 / 2.75 = 0.72 T e = 6 / 2.25 = 2.66
Image of page 43
BYU CS 345 Scheduling 44 Guaranteed Scheduling Guaranteed Scheduling If n users then you get 1/ n of CPU Or if n processes then you get 1/ n of CPU Track creation time Track time actually used Compute time since creation divided by n --- this is the time you are entitled too CPU Consumed / CPU entitled 0.5 only half of what it should have had 2.0 Twice more than entitled Choose process with least ratio
Image of page 44

Subscribe to view the full document.

BYU CS 345 Scheduling 45 Lottery Scheduling Lottery Scheduling P 0 30% P 2 15% P 3 25% P 4 30% 100 Lottery Tickets T = 30 T = 15 T = 25 T = 30 Ticket holder gets CPU until next drawing
Image of page 45
BYU CS 345 Scheduling 46 Lottery Scheduling Lottery Scheduling Issue tickets to process Choose random ticket as the next job If you have the ticket, then its you Assign number of tickets by priority If 100 tickets, if process has 20 tickets, then 20% chance it wins the lottery Can exchange tickets Can award tickets to priority boost
Image of page 46

Subscribe to view the full document.

BYU CS 345 Scheduling 47 Fair Scheduling Fair Scheduling
Image of page 47
Image of page 48
You've reached the end of this preview.
  • Winter '12
  • EricMercer
  • Scheduling algorithms, FCFS, BYU CS

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern