WorksheetsLesson 5 - CPU Scheduling
Total questions: 25
Worksheet time: 14mins
Process execution consists of a cycle of _________ and ________.
CPU execution
I/O wait
RAM storage
CPU burst is followed by I/O burst.
True
False
In CPU Scheduling, CPU burst distribution is not the main concern.
True
False
Selects from among the processes in ready queue, and allocates the CPU to one of them.
Short-term scheduler
Long-term scheduler
CPU scheduler
CPU scheduling decisions may take place when a process:
Switches from running to waiting state
Switches from running to ready state
Switches from running to terminated
Switches from waiting to ready
Terminated
Does not cut execution.
Preemptive
Nonpreemptive
Cuts execution.
Preemptive
Nonpreemptive
Gives control of the CPU to the process selected by the short-term scheduler.
Dispatcher
CPU controller
Short-term CPU
Dispatcher includes:
switching context: saving and loading state
switching to user mode
Jumping to the proper location in the user program
Jumping to the improper location in the user program
What are the 5 scheduling criteria?
CPU Utilization
Throughput
Turnaround time
Waiting Time
Response Time
Keep the CPU as busy as possible.
CPU Utilization
Throughput
Turnaround time
Waiting Time
Response Time
# of processes that complete their execution per time unit.
CPU Utilization
Throughput
Turnaround time
Waiting Time
Response Time
Amount of time to execute a particular process.
CPU Utilization
Throughput
Turnaround time
Waiting Time
Response Time
Amount of time a process has been waiting in the ready queue.
CPU Utilization
Throughput
Turnaround time
Waiting Time
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)
CPU Utilization
Throughput
Turnaround time
Waiting Time
Response Time
Scheduling Algorithm Optimization Criteria
Max CPU utilization
Max throughput
Min turnaround time
Min waiting time
Min response time
Short process behind long process (applies to SJF, short process first)
Convoy effect
Convey effect
Conveyor effect
Associate with each process the length of its next CPU burst.
First-Come, First-Served Scheduling
Shortest-Job-First Scheduling
Shortest-Remaining-Time-First Scheduling
Priority Scheduling
Round Robin
A priority number (integer) is associated with each process.
First-Come, First-Served Scheduling
Shortest-Job-First Scheduling
Shortest-Remaining-Time-First Scheduling
Priority Scheduling
Round Robin
The CPU is allocated to the process with the highest priority.
(smallest integer = highest priority)
True
False
SJF is priority scheduling where priority is the inverse of predicted next CPU burst time.
True
False
Low priority processes may never execute.
Starvation
Aging
As time progresses increase the priority of the process.
Starvation
Aging
Each process gets a small unit of CPU time, usually 10-100 milliseconds.
After this time has elapsed, the process is preempted and added to the end of the ready queue.
First-Come, First-Served Scheduling
Shortest-Job-First Scheduling
Shortest-Remaining-Time-First Scheduling
Priority Scheduling
Round Robin
A small unit of CPU time (10-100).
Quantum time
Time slice
Millisecond
