Process Scheduling
Process Scheduling
Process Scheduling
Prepared By
Dr.Rekha.K.S
Associate Professor
Dept of CS&E,NIE
Process Scheduling
• In a single-processor system, only one process can run
at a time; any others must wait until the CPU is free and
can be rescheduled.
• The objective of multiprogramming is to have some
process ruming at all times, to maximize CPU utilization
• CPU scheduling is the basis of multiprogram operating
systems.
• By switching the CPU among processes, the operating
system can make the computer more productive.
Schedulers
• Turnaround time The interval from the time of submission of a process to the
time of completion is the turnaround time. Turnaround time is the sum of the
periods spent waiting to get into memory, waiting in the ready queue, executing
on the CPU, and doing I/O.
Time spent waiting (to get into memory + ready queue + execution + I/O)
• Response time: another measure is the time from the submission of a request until
the first response is produced. This measure, called response time, is the time it takes
to start responding, not the time it takes to output the response.
• If non preemptive algorithm, then response time and waiting time will be equal
What is Preemptive Scheduling?
• the process that requests 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 queue, its PCB(Process
Control Block) is linked onto the tail of the queue.
• When the CPU is free, it is allocated to the process at the
head of the queue.
• The running process is then removed from the queue. The
code for FCFS scheduling is simple to write and understand.
First-Come, First-Served Scheduling
• Process Burst Time
• p1 24
• p2 3
• P3 3
• If the processes arrive in the order P1, P2, P3, and are
served in FCFS order, we get the result shown in the
following Gantt chart
• Gantt Chart: is a bar chart that illustrates a particular
schedule, including the start and finish times of each of
the participating processes
Average waiting time is = (6+0+3)/3= 3
milliseconds
Convoy Effect
• convoy effect as all the other processes wait for the one
big process to get off the CPU.
• This effect results in lower CPU and device utilization
than might be possible if the shorter processes were
allowed to go first.
Shortest-Job-First Scheduling