Job Scheduling Group2-1
Job Scheduling Group2-1
Researchers
3. Gugulethu Nxumalo
4. Makanaka Mabobe
5. Micheal Chikowore
Presenters
6. Samson Nyalungwe
7. Mawethu Sikhosana
8. Cynthia Tadhuvana
9. Bridget Siziba
10.Nkosikhona Mhlope
JOB SCHEDULING
What Does Job Scheduling Mean?
P0 0-0=0
P1 5-1=4
P2 8-2=6
P3 16 - 3 = 13
SJF scheduling
Shortest job first (SJF), also known as shortest job next (SJN), selects a job that would require
the shortest processing time and allocates it to the CPU. This algorithm associates each
process with the length of the next CPU burst. A CPU burst is when processes utilize the CPU
before it’s no longer ready.
Suppose two jobs have the same CPU burst. The scheduler would then use the FCFS
algorithm to resolve the tie and move one of them to execution.
Below are the advantages and disadvantages of the shortest job first scheduling.
Advantage: The throughput is high as the shortest jobs are preferred over a long-run
process.
Disadvantage: Records elapsed time that adds to additional overhead on the CPU.
Furthermore, it can result in starvation as long processes will be in the queue for a long
time.
Given: Table of processes, and their Arrival time, Execution time
P0 0 5 0
P1 1 3 5
P2 2 8 14
P3 3 6 8
Waiting time of each process is as follows −
P0 0-0=0
P1 5-1=4
P2 14 - 2 = 12
P3 8-3=5
Priority scheduling
Priority scheduling associates a priority (an integer) to each process. The one with the highest
priority gets executed first. Usually, the smallest integer is assigned to a job with the highest
priority. If there are two jobs with similar priority, the algorithm uses FCFS to determine which
would move into processing.
Priority scheduling is a non-pre-emptive algorithm and one of the most common scheduling
algorithms in batch systems.
Each process is assigned a priority. Process with highest priority is to be executed first and so
on.
Processes with same priority are executed on first come first served basis.
Priority can be decided based on memory requirements, time requirements or any other resource
requirement.
P0 0 5 1 0
P1 1 3 2 11
P2 2 8 1 14
P3 3 6 3 5
Waiting time of each process is as follows −
P0 0-0=0
P1 11 - 1 = 10
P2 14 - 2 = 12
P3 5-3=2
Round robin scheduling
Round robin scheduling is designed for time-sharing systems. It’s a pre-emptive scheduler based on the clock and
is often called a time-slicing scheduler. Whenever a periodic clock interval occurs, the scheduler moves a currently
processing job to the ready queue. It takes the next job in the queue for processing on a first-come, first-serve
basis.
Deciding a time quantum or a time slice is tricky in this scheduling algorithm. If the time slice is short, small jobs get
processed faster.
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P3 (9 - 3) + (17 - 12) = 11
Shortest Remaining Time
Shortest remaining time (SRT) is the pre-emptive version of the SJN algorithm.
The processor is allocated to the job closest to completion but it can be pre-empted
by a newer ready job with shorter time to completion.
Impossible to implement in interactive systems where required CPU time is not
known.
It is often used in batch environments where short jobs need to give preference.
Advantages of Using a Job Scheduling Software