Front | Back |
What is happening when a process switches from the running state to waiting state or when a process terminates?
|
OS scheduling scheme is nonpreemptive or cooperative
|
What is happening when a process switches from running state to ready state or switches from waiting state to ready state? Here the cpu has been allocated to a process and the process keeps the cpu until it releases it either by terminating or by switching to waiting state.
|
OS scheduling scheme is preemptive
|
What is another component involved in the CPU scheduling function
|
Dispatcher is the module that gives control of the cpu to the process selected by the short-term scheduler. The dispatcher should be as fast as possible
|
What are the criteria for comparing cpu scheduling algorithms
|
CPU utilization; throughput, turnaround time, waiting time and response time
|
What is CPU utilization
|
Keeping the cpu as busy as possible. Conceptually, cpu utilization can range from 0 to 100%. In a real system, it should range from 40% to 90%
|
What is throughput
|
If the cpu is busy exeg processes, then work is being done. One measure of work is the number of processes that are completed per time unit
|
What is Turnaround time
|
From the point of view of a particular process, the important criterion is how long it takes to execute that process. The interval from the time of submission of a process to the time of completion is the turnaround time.
|
What is Waiting Time
|
The CPU scheduling algorithm does not affect the amount of time during which a process executes or does i/o; it affects only the amount of time that a process spends waiting in the ready queue. Waiting time is the sum of the periods spent waiting in the ready queue.
|
What is Response Time?
|
In an interactive system, turnaround time may not be the best criterion. Often, a process can produce some output fairly early and can continue computing new results while previous results are being output to the user. Thus, another measure is the time from the submission of a req until the first response is produced. It's the time it takes to start responding, not the time it takes to output the response.
|
First-come, first-serve
|
The process that reqs the cpu first is allocated the cpu first. The implementation of the FCFS policy is easily managed with a FIFO queue. When a process enters the ready q, its PCB is linked onto the tail of the q. When the cpu is free, it is allocated to the process at the head of the q. The running process is then removed from the q.
|
Shortest-Job-First Scheduling
|
This algorithm associates with each process the length of the process's next cpu burst. When the cpu is available, it is assigned to the process that has the smallest next cpu burst. If the next cpu bursts of two processes are the same FCFS scheduling is used to break the tie
|
Priority Scheduling
|
A priority is associated w each process and the cpu is allocated to the process with the highest priority. Equal-priority processes are scheduled in FCFS order
|
Indefinite blocking or starvation
|
A process that is ready to run but waiting for the cpu can be considered blocked. A priority scheduling algorithm can leave some low priority processes waiting indefinitely. In a heavily loaded computer sys, a steady stream of higher priority processes can prevent a low priority process from getting the cpu. Either the process will eventually be run or the sys will eventually crash and lose all unfinished low priority processes
|
What is aging
|
A technique of gradually increasing the priority of processes that wait in the sys for a long time
|
Roung-Robin Scheduling
|
Designed especially for time sharing systems. It is similar to FCFS but preemption is added to enable the sys to switch btw processes. A small unit of time, called a TIME QUANTUM or time slice, is defined. generally 10-100 miliseconds. The ready q is treated as a circular q. The cpu scheduler goes around the ready q, allocating the cpu to ea process for a time interval of up to 1 time quantum.
|