Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

ABASYN UNIVERSITY PESHAWAR

DEPARTMENT OF COMPUTER SCIENCE

Assignment # Operating system

Subject:- OS

Class /section:- CA

Submitted to:- Lecturer Wajid Ullah

Submitted by:- Adnan Alam

Reg no: 13800


Quesion1: Describe the following scheduling algorithms

Non-Pre-Emptive:
Non-preemptive Scheduling is used when a process terminates, or a process switches from
running to the waiting state. In this scheduling, once the resources (CPU cycles) are allocated to
a process, the process holds the CPU till it gets terminated or reaches a waiting state. In the case
of non-preemptive scheduling does not interrupt a process running CPU in the middle of the
execution. Instead, it waits till the process completes its CPU burst time, and then it can allocate
the CPU to another process.

First Come, First Serve:


First come first serve (FCFS) scheduling algorithm simply schedules the jobs according to
their arrival time. The job which comes first in the ready queue will get the CPU first. The
lesser the arrival time of the job, the sooner will the job get the CPU.

Round Robin:
In this algorithm, every process gets executed in a cyclic way. A certain time slice is defined in
the system which is called time quantum. Each process present in the ready queue is assigned
the CPU for that time quantum, if the execution of the process is completed during that time then
the process will terminate else the process will go back to the ready queue and waits for the
next turn to complete the execution.

Preemptive Shortest Job First:


Shortest Job First (SJF) is an algorithm in which the process having the smallest execution
time is chosen for the next execution. This scheduling method can be preemptive or non-
preemptive. It significantly reduces the average waiting time for other processes awaiting
execution.

Priority scheduling Algorithm (Non-Preemptive):


In the Non Preemptive Priority scheduling, The Processes are scheduled according to the priority
number assigned to them. Once the process gets scheduled, it will run till the completion.
Generally, the lower the priority number, the higher is the priority of the process.

b) Given the following processes and burst times


Process Arrival Burst Completion TAT Waiting Response
Time Time Time Time time

P1 0 13 13 13 0 17

P2 1 5 18 17 13 24

P3 3 23 41 38 15 68

P4 4 3 44 40 37 33

P5 5 31 75 70 41 111

P6 6 3 78 72 69 77

P7 7 14 92 85 71 110
______________________THE END__________________________

You might also like