Sie sind auf Seite 1von 3

CPU scheduling 

- Process which allows one process in cpu to run while other process 
waits for the availability of the resources (when the running process 
finished) 
- Os executes ready queue process when the cpu is idle which the 
selection process is carried by the short-term scheduler or cpu 
scheduler 
 
CPU scheduling: Dispatcher 
- Module that gives control of the cpu to the process selected by 
the short-term scheduler or cpu scheduler (switching context, 
switching to user mode, jumping to the proper location in the 
user program to restart the program to restart the program from 
where it left last time) 
- Dispatch latency is the time taken by the dispatcher to stop one 
process and start another one

Types of CPU scheduling 


  
Four circumstances: (1 & 4 is non-preemptive -no choice but to execute ready 
queue process, 2 & 3 is preemptive -there is a choice) 
- Process switches from the running state to waiting state (for I/O request 
or invocation of wait for the termination of one of the child processes) 
- Process switches from the running state to ready state (when an 
interruption occurs) 
- Process switches from the waiting state to the ready state (completion 
of I/O) 
- Process terminates 
 
 
Non-preemptive scheduling
- The running process keeps the cpu until it is terminated or 
switched to the waiting state 
Preemptive scheduling 
- Cpu runs the task with high priority and interrupt the running 
process then continue when the prioritized task is completed 
 
Scheduling Criteria 
- Cpu utilization​ - cpu ideally should run 100% all the time or 40% for light 
loaded process and 90% for heavy loads. 
- Throughput​ - total amount of work done in a unit of time 
- Turnaround time​ - time taken to execute a process -- interval from time 
of submission of the process to the time of completion of the process  
- Waiting time​ - sum of the periods spent waiting in the ready queue 
- Load average​ - average number of processes residing in the ready 
queue waiting for their turn to get into cpu 
- Response time​ - time to get a first response when a request is 
submitted 
 
Scheduling Algorithms 
- First come, first serve (FCFS) scheduling ​- process who requests cpu 
first, gets the cpu allocated first.  
- Like first in, first out (FIFO) queue data structure  
- Used in batch systems 
- Whatever is in the head of the queue get executed first rather 
than the new process at the tail  
- E.g. buying ticket at ticket counter 
Calculating Average Waiting Time 
- AWT is the average of the waiting times of the processor in 
the queue, waiting for the scheduler to pick them for 
execution 
-  
- Shortest-job-first (SJF) scheduling 
- Shortest remaining time first (SRTF) scheduling 
- Round robin (RR) scheduling 
- Non-preemptive priority scheduling 
- Preemptive priority scheduling 
 
 
 

Das könnte Ihnen auch gefallen