Scheduling Flashcards
What is scheduling?
process of determining which processes or tasks should be executed by the CPU in a given system at any given time.
When does a scheduling decision need to be made?
- when a new process is created
- when a process exits
- when an I/O interrupt occurs
What are some goals of scheduling algorithms in different environments?
- fairness,
- policy enforcement,
- balance
- CPU utilization,
- response time
Why is fairness important in scheduling?
ensures that comparable processes get comparable service, and it prevents one process from monopolizing the CPU at the expense of others.
What are some metrics used to evaluate the performance of batch systems?
- Throughput (number of jobs completed per hour),
- turnaround time (time from submission to completion),
- CPU utilization
In which environments does scheduling?
- networked servers where multiple processes often compete for the CPU
- mobile devices with weak CPUs and limited memory.
What are some considerations for the scheduler to make efficient use of the CPU?
- minimize the number of process switches per second (to save cost)
- Switching from user mode to kernel mode
- Saving the state of the current process, and reloading the memory map.
What is round-robin scheduling?
Each process is assigned a time quantum during which it can run. If a process is still running at the end of the quantum, the CPU is preempted and given to another process.
Setting the quantum too short in round-robin scheduling can cause too many process switches, resulting in lower CPU efficiency.
What is priority scheduling?
each process is assigned a priority, and the process with the highest priority is allowed to run.
Priorities can be assigned statically or dynamically. They can be based on factors such as user roles, job costs, or system goals.
What is the advantage of eliminating preemption in priority scheduling?
improves performance because process switches only occur when necessary, such as when a process blocks and cannot continue.
What is the ‘shortest process next’ scheduling algorithm?
runs the process with the shortest estimated running time first. It aims to minimize overall response time by executing the shortest job.
What is guaranteed scheduling?
system makes real promises to users about performance and aims to fulfill those promises.
How does lottery scheduling work?
assigns lottery tickets to processes for various system resources. When a scheduling decision needs to be made, a ticket is randomly chosen, and the process holding that ticket gets the resource. The more tickets a process holds, the higher its chances of winning.
+ provides predictable results and is relatively easy to implement
What is fair-share scheduling?
takes into account the ownership of processes when scheduling. It ensures that each user or group receives a fair share of the system resources based on their entitlement.