CPU Scheduling Flashcards
What is the main objective of CPU scheduling?
To introduce CPU scheduling, which is the basis for multiprogrammed operating systems.
What are the criteria for evaluating CPU scheduling algorithms?
- CPU utilization
- Throughput
- Turnaround time
- Waiting time
- Response time
What does CPU–I/O Burst Cycle refer to?
Process execution consists of a cycle of CPU execution and I/O wait.
What is the role of a CPU Scheduler?
The short-term scheduler selects from among the processes in the ready queue and allocates the CPU to one of them.
When do CPU scheduling decisions take place?
- Switches from running to waiting state
- Switches from running to ready state
- Switches from waiting to ready
- Terminates
What is the difference between preemptive and nonpreemptive scheduling?
Scheduling under switching from running to waiting or terminating is nonpreemptive; all other scheduling is preemptive.
What is dispatch latency?
Time it takes for the dispatcher to stop one process and start another running.
Define CPU utilization in scheduling criteria.
Keep the CPU as busy as possible.
What is throughput in the context of CPU scheduling?
Number of processes that complete their execution per time unit.
What is turnaround time?
Amount of time to execute a particular process.
What is waiting time?
Amount of time a process has been waiting in the ready queue.
Define response time in CPU scheduling.
Amount of time it takes from when a request was submitted until the first response is produced.
What is the optimization criteria for scheduling algorithms?
- Max CPU utilization
- Max throughput
- Min turnaround time
- Min waiting time
- Min response time
Describe First-Come, First-Served (FCFS) scheduling.
Processes are scheduled in the order they arrive.
What is the average waiting time for processes in FCFS scheduling?
Calculated by averaging the individual waiting times of all processes.
What is the convoy effect in CPU scheduling?
Occurs when short processes are stuck behind long processes.
What is Shortest-Job-First (SJF) scheduling?
Schedules the process with the shortest time for its next CPU burst.
Why is SJF considered optimal?
It gives minimum average waiting time for a given set of processes.
How can the length of the next CPU burst be predicted?
By estimating it based on previous CPU bursts.
What is the preemptive version of SJF called?
Shortest-Remaining-Time-First.
What is the problem associated with priority scheduling?
Starvation, where low priority processes may never execute.
What is aging in the context of scheduling?
Increasing the priority of a process over time to prevent starvation.
Describe Round Robin (RR) scheduling.
Each process gets a small unit of CPU time, usually 10-100 milliseconds, before being preempted.
What is the performance aspect of Round Robin scheduling?
If q is large, it behaves like FIFO; if q is small, it must be large compared to context switch time.