5 Round-Robin Scheduling If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than(n-1)q time units.
6 Round-Robin Scheduling Performanceq large => FIFOq small => q must be large with respect to context switch, otherwise overhead is too highTypically, higher average turnaround than SJF, but better response
8 Multilevel Queue Ready queue is partitioned into separate queues: foreground (interactive)background (batch)Each queue has its own scheduling algorithmforeground – RR background – FCFS
9 Multilevel Queue example Foreground P (RR interval:20)PPBackground P (FCFS)P
10 Multilevel Queue Scheduling must be done between the queues Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation.Time slice – each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR
12 Multilevel Feedback Queue Three queues:Q0 – RR with time quantum 8 millisecondsQ1 – RR time quantum 16 millisecondsQ2 – FCFSSchedulingA new job enters queue Q0 which is served FCFS. When itgains CPU, job receives 8 milliseconds. If it does not finish in 8milliseconds, job is moved to queue Q1.At Q1 job is again served FCFS and receives 16 additionalmilliseconds. If it still does not complete, it is preempted andmoved to queue Q2.
15 5.4 Multiple-Processor Scheduling We concentrate on systems in which the processors are identical (homogeneous)Asymmetric multiprocessing (by one master) is simple because only one processor access the system data structures.Symmetric multiprocessing, each processor is self-scheduling. Each processor may have their own ready queue.
16 Load balancingOn symmetric multiprocessing systems, it is important to keep the workload balanced among all processors to fully utilized the benefits of having more than one CPUThere are two general approached to load balancing: Push Migration and Pull Migration
17 Symmetric Multithreading An alternative strategy for symmetric multithreading is to provide multiple logical processors (rather than physical)It’s called hyperthreading technology on Intel processors
18 Symmetric Multithreading The idea behind it is to create multiple logical processors on the same physical processor (sounds like two threads)But it is not software provide the feature, but hardwareEach logical processor has its own architecture state, each logical processor is responsible for its own interrupt handling.
22 Solaris Scheduling Solaries uses priority-based scheduling The default scheduling class for a process is time sharingThe higher the priority, the smaller the time sliceThe scheduling policy gives good response time for interactive process and good throughput for CPU-bound processIt includes 60 priority levels
23 Solaris Dispatch Table Priority: a higher number indicates a higher priorityTime Quantum: the time quantum for the associated priorityTime Quantum expired: the priority of a thread that has used its entire time quantum without blockingReturn from sleep: the priority of a thread that is returning from sleeping (such as waiting for I/O)
25 Windows XPWindows XP schedules threads using a priority-based, preemptive scheduling algorithmThe values of the priority classes appears in the top rowThe left columns contains the values for the relative priorities.The base priority is the value of the normal relative priority for the specific class
27 Linux SchedulingThe Linux scheduling use a preemptive, priority based algorithm with two separate priority ranges: a real-time range from 0 to 99 and a nice value ranging from 100 to 140Lower values indicates higher priorityUnlike Solaries and XP, Linux assigns higher-priority tasks longer time quanta
31 Deterministic Modeling Deterministic model is simple and fast. It gives the exact numbers, allowing us to compare the algorithms. However, it requires exact numbers for input, and its answers apply only to these cases.