ANNOUNCEMENTS Last week of oct: Office hours 3-5 WEDNESDAY!! Just that one week There is a list of students on the registrar's list on the www. I put version of class notes by lecture on the www. ONLY THE FULL VERSION WILL BE UPDATED Round Robin (RR) Quantum Timer interrupt Preemptive version of FCFS In limit (as quantum --> 0) becomes processor sharing (PS) How big to make quantum Shorter makes more responsive Longer is more efficient since less switching State Dependent RR RR but quantum depends on load HOMEWORK 5.3, 5.4 Selfish Round Robbin (SRR) "Accepted" procs run RR New Proc enters at prio 0 (low) and wait until its prio reaches that of accepted procs. New procs have prio increase at rate a >= 0 Accepted procs increase prio b >= 0 All accepted procs have same prio b >=a ==> FCFS b = 0 ==> RR a > b > 0 interesting HOMEWORK 5.7 (remind me to do it next week) Highest Penalty Ratio Next (HPRN) Priority = (time in system) / (running time) High priority goes first Another example of priority scheduling Aka Highest Response Ratio Next (HRN) Non-preemptive To make pre-emptive do not have to worry about new jobs (undefined ratio) but do have to compute when the current process won't be highest priority and set timer. Multiple Queues For example, batch vs. interactive or large mem vs small or paying customers vs courtesy users Treat each queue independently and then have some higher level procedure to arbitrate between queues. For example batch jobs get big quanta but rarely Processes stay in the same queue Multilevel feedback queues Several queues with different scheduling policies on each Idea is to get something like SJF by first going to the high level queue. Also have rare big quanta for batch jobs like multiple queues but we determine the "batch" jobs dynamically (internally). When does a process move to lower queue? Say when uses up a full quantum. When move to higher queue? Say when didn't use quantum. Worse queue is often FCFS This can starve other jobs in the lowest queue HOMEWORK 5.6 Scheduling Multiple Processors In the most tightly-coupled case SMP (symmetric multiprocessors), can have ONE ready queue with all processors accessing it. For large numbers of processors can get serious contention problems unless you have something fancy (e.g. NYU Ultracomputer). Sometimes some processes need to be scheduled together else one spin waits for the the other (unscheduled) processor. Gang scheduling Now OS is a parallel program. Can also restrict the OS to one processor and have it schedule the others. Called Master-slave OS. Better name would be Master-slaves. When the processors are not the same, cannot really have one process queue. Sometimes want jobs to stay on the same processor even when the processors are identical (cache effects). Sometimes have networks of autonomous machines with each with its own scheduler (indeed its own OS). Then clearly can't share ready queue.