CPU scheduing Flashcards
-process execution consists of a cycle of CPU execution and I/O wait.
CPU-I/O Burst Cycle
-selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.
-decisions:
1) switches from running to waiting state
2) switches from running to ready state
3) switches frm waiting to ready
4) terminates
scheduling under 1 and 4 is nonpreemptive
all other scheduling is preemptive
CPU scheduler
-this 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.
dispatcher
-time it takes for the dispatcher to stop one process and start another running
dispatch latency
(scheduling criteria)
-keep the CPU as busy as possible
CPU utilization
(scheduling criteria)
-# of processes that complete their execution per time unit
throughput
(scheduling criteria)
-amount of time to execute a particular process
turnaround time
(scheduling criteria)
-amount of time a process has been waiting in the ready queue.
waiting time
(scheduling criteria)
-amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
response time
max CPU utilization
max throughput
min turnaround time
min waiting time
min response time
optimization criteria
-once CPU given to the process it cannot be preempted until complete its CPU burst.
nonpreemptive
-if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the shortest-remaining-time-first (SRTF)
preemptive
-associate with each process the length of its nexxt CPU burst. Use these length to schedule the process with the shortest time.
-is optimal-gives minimum average waiting time for a given set of processes.
shortest-job-first (SJR) scheduling
-a priority number (integer) is associated with each process.
-the CPU allocated to the process with the highest priority (smallest integer = highest priority).
priority scheduling
the problem with priority scheduling
-low priority processes may never execute
starvation