Test 1 Flashcards
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:
- Switches from running to waiting state
- Switches from running to ready state
- Switches from waiting to ready
- Terminates
What is the dispatcher module?
Gives control of the CPU to the process selected by the short-term scheduler; this involves:
- switching context
- switching to user mode
- jumping to the proper location in the user program to restart that program
What is dispatch latency?
Time it takes for the dispatcher to stop one process and start another running
What are the scheduling criteria?
- CPU utilization – keep the CPU as busy as possible
- Throughput – # of processes that complete their execution per time unit
- Turnaround time – amount of time to execute a particular process
- Waiting time – amount of time a process has been waiting in the ready queue
- Response time – amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
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.