What does a CPU scheduler do?
Selects from among the processes in ready queue, and allocates a CPU core to one of them
When are CPU scheduling decisions made?
When a process:
What is the dispatcher module?
Gives control of the CPU to the process selected by the short-term scheduler; this involves:
What is dispatch latency?
Time it takes for the dispatcher to stop one process and start another running
What are the scheduling criteria?
What is FCFS scheduling?
First-Come First-Served scheduling. Processes are ran in the order that they arrive.
What is the Convoy effect?
When short-processes are stuck behind long processes.
What is SJF scheduling?
Associate each process the length of its next CPU burst and use these lengths to schedule the process with the shortest time.
SJF is optimal, it gives the minimum average waiting time for a given set of processes, but the difficulty is knowing the length of the next CPU request.
How do you determine the length of the next CPU burst?
Tn+1 = atn + (1-a)Tn
tn = actual length of nth CPU burst
Tn+1 = predicted value for the next CPU burst
a0 <= a <= 1
Commonly a set to 1/2
What is RR scheduling?
Round Robin scheduling. Each process gets a small unit of CPU time (time quantum q) usually 10-100ms. After this time has elapsed, the process is preempted and added to the end of the ready queue..
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.
Timer interrupts every quantum to schedule next process.
What is priority scheduling?
A priority is associated with each proces.
The CPU is allocated to the process with the highest priority.
What is starvation and aging?
In priority scheduling starvation means that low priority processes may never execute. The solution to this is increasing the priority of the process as it ages, referred to as aging.
What is the effect of quantum size in RR?
If q large, it is similar to a FIFO algorithm. If q is too small overhead will be too high with constant switching.
What is a multilevel queue?
With priority scheduling having separate queues for each level of priority. Schedule the process in the highest-priority queue.
What is a multilevel feedback queue?
A multilevel queue where processes can move between the various queues, aging can be implemented this way.
What defines multilevel feedback queue schedulers?
What is thread scheduling? What are the types?
What is multiple-processor scheduling?
What is SMP?
Symmetric multiprocesseing where each processor is self scheduling. All threads may be in a common ready queue, each processor may have its own private queue of threads.
What is multicore processing?
What are multithreaded multicore systems?
What are the 2 levels of multithreaded multicore systems?
What is load balancing? What are some methods?
What is processor affinity? What are some kinds?