Scheduling Flashcards
Dispatcher
Performs the decision the scheduler makes. Switches context, user mode and restarts programs.
Dispatch Latency
Time it takes for the dispatcher to stop one process and start another.
- CPU utilization
- Throughput
- Turnaround time
- waiting time
- Response time
- CPU utilization - how busy the CPU is
- Throughput - number of processes that complete their execution in a time frame
- Turnaround time - amount of time to execute a specific process
- waiting time - time a process is in the ready queue
- Response time - time it takes from when a request is submitted to the first response
FCFS
First Come, First Serve - Non preemptive
SJF
Shortest Job First. Gives minimum average waiting time. Hard to know CPU burst time.
Nonpreemptive - When a CPU runs a task, it will finish it without disturbing it.
Preemptive - If a new task arrives and is shorter than the remaining time of the current task, switch between them.
Next burst length estimation
Using exponential averaging:
Tn+1 = aTn + (1-a)Tn
Priority Scheduling
A priority is given to each process. The highest priority (lowest number) task is scheduled first. To prevent starvation, implement an aging system where you increase the priority for older tasks.
RR
Round Robin.
Each process gets a fixed time quantum (q) to run in a round manner.
Multilevel Queue
Ready queue is partitioned into separate queues, for example, foreground and background. each queue has its own scheduling algorithm. scheduling between the queues is done by either giving one queue full priority over the other or by time slicing (each queue gets a fixed percentage of CPU time)
MLFQ
Multi Level Feedback Queue.
Multiple queues with different priorities. Each has a defined timeing algorithm and there are methods to demoting and premoting a process between the queues.
PCS
Process-Contention Scope: Scheduling competition for user threads when the thread library schedules the threads.
SCS
System-Contention Scope: Scheduling competition for kernel threads since they are system wide.