Operating System Scheduling algorithms
Operating System Scheduling algorithms
Unit:1
Concept of Process:
A process is defined as a sequence of instructions are executed in a
predefined order. In simple words, any program that is executed is termed as
a process. Processes change its state as it executes and can be either new,
ready, running, waiting or terminated.
Process states:
• Process goes through different states throughout the life cycle which
are called process states. New, Ready, Running, Waiting or Block,
Terminated or Completed, Suspend ready, and Suspend wait or
blocked are different states which process might go during the life
cycle.
• This model consists of five states i.e, running, ready, blocked, new, and
exit. The model works when any new job/process occurs in the queue,
it is first admitted in the queue after that it goes in the ready state.
Now in the Ready state, the process goes in the running state.
Proces
Wait Time : Service Time - Arrival Time
s
P0 0-0=0
P1 5-1=4
P2 8-2=6
P3 16 - 3 = 13
P0 0 5 0
P1 1 3 5
P2 2 8 14
P3 3 6 8
Waiting time of each process is as follows −
Proces
Waiting Time
s
P0 0-0=0
P1 5-1=4
P2 14 - 2 = 12
P3 8-3=5
P0 0 5 1 0
P1 1 3 2 11
P2 2 8 1 14
P3 3 6 3 5
Proces
Waiting Time
s
P0 0-0=0
P1 11 - 1 = 10
P2 14 - 2 = 12
P3 5-3=2
Proces
Wait Time : Service Time - Arrival Time
s
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P3 (9 - 3) + (17 - 12) = 11
For example, CPU-bound jobs can be scheduled in one queue and all I/O-
bound jobs in another queue. The Process Scheduler then alternately selects
jobs from each queue and assigns them to the CPU based on the algorithm
assigned to the queue.
Kickstart Your Career
Get certified by completing the course