Beruflich Dokumente
Kultur Dokumente
✓ First come first served, also known as First In, First Out
(FIFO) allocates the CPU based on the time of arrival. It is
the simplest, and most common policy done to put order
in executing processes in the processor. Its main
disadvantage is poor performance which creates “convoy
effect”. The process in line will rely primarily on the
process in execution.
To illustrate this algorithm, let us solve the given problem. At time
= 0, we have only one job in the ready queue hence, the only job which
the short-term scheduler can choose is J1. J1 will execute with a burst of
12. At time=12, There are already 2 jobs in the ready queue, namely J2
and J3. Since J2 arrived first, J2 will process for a burst of 5 until time=27.
At time=27, the only job in the ready queue is J5. J5 will process until
time=36. The Gantt Chart will look like:
SHORTEST JOB FIRST (SJF)
In the shortest job first algorithm, the steps to single out a process
are as follows:
1. Check the time of arrival in the ready queue.
2. From the list of jobs in the ready queue, the job with the shortest
burst is allotted the processor and terminates when the burst time is
completed. In case where burst time of processes / jobs are the
same, use FCFS as the tie breaker.
NON-PREEMPTIVE PRIORITY (NPP)
In the non-preemptive priority algorithm, the steps to single out a
process are as follows:
1. Check the time of arrival in the ready queue.
2. From the list of jobs in the ready queue, identify and process
the job with the highest priority ( 1 being the highest). The chosen
job terminates when the burst time is completed. In case the assigned
priority of jobs are the same, use FCFS to pick the job which will
execute.
PREEMPTIVE PRIORITY (PP)
In preemptive priority algorithm, the steps to single out a process are
as follows:
1. Check the time of arrival in the ready queue.
2. From the list of jobs in the ready queue, identify and
process the job with the highest priority ( 1 being the highest). The
chosen job will be preempted to move out if an incoming job in the
ready queue has a higher priority.
SHORTEST REMAINING TIME FIRST (SRTF)
The shortest remaining time first is preemptive shortest job first. The
steps to single out a process to process are as follows:
1. Check the time of arrival in the ready queue.
2. From the list of jobs in the ready queue, identify and process the
job with the shortest remaining time (burst time). The chosen job will be
preempted to move out if an incoming jo0b in the ready queue has a
shorter remaining time.
ROUND ROBIN (RR)
✓ In round robin, the time slice should be specified. The time
slice or quantum defines the amount of time that a job is
allocated the processor.
✓ As the time slice of a job expires, it is preempted at that specific
time to go back to the tail of the ready queue. A job is terminated
when all its bursts have been completed otherwise it has to go
back to the ready queue.
✓ Assuming that P! has a bursts time of 23, and the quantum given is
5, P1 needs to go back to the processor 5 times to complete its
burst and terminate. The fifth time it goes to the processor will
only be to finish the remaining 3 burst.
The steps to single out a process are as follows:
1. Check all jobs and arrange them according to the time of arrival.
2. From the list of jobs in the ready queue, identify and process the
job according to the time slice specified. If the time slice is
greater than the burst time, the process is terminated when the
burst time is completed. If the time slice is less than the burst time,
the job expires at the end of the given time slice and returns to the
ready queue.
The following steps above are followed until the ready queue
becomes empty. Take note that every time a job is preempted, it goes
back to the ready queue at the time it was preempted.