K. J.
Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics Engineering
Course Name: Computer Operating System (Elective) Semester: VII
Date of Performance: / / 2024 Batch No:
Faculty Name: Roll No:
Faculty Sign & Date: Grade/Marks: / 25
Expt No: 5
Title: Implementation of Basic Process management algorithms – Pre emptive
(SRTN, RR, priority).
Aim and Objective of the Experiment:
To implement basic Process management algorithms (Round Robin, SRTN, Priority).
COs to be achieved:
CO 2: To understand the concept of process, thread and resource management.
Theory:
Most systems have a large number of processes with short CPU bursts interspersed between I/O
requests and a small number of processes with long CPU bursts. To provide good time-sharing
performance, we may preempt a running process to let another one run. The ready list, also known as
a run queue, in the operating system keeps a list of all processes that are ready to run and not blocked on
some I/O or other system request, such as a semaphore. Then entries in this list are pointers to the
process control block, which stores all information and state about a process.
When an I/O request for a process is complete, the process moves from the waiting state to
the ready state and gets placed on the run queue.
The process scheduler is the component of the operating system that is responsible for deciding
whether the currently running process should continue running and, if not, which process should run
next. There are four events that may occur where the scheduler needs to step in and make this
decision:
1. The current process goes from the running to the waiting state because it issues an I/O request
or some operating system request that cannot be satisfied immediately.
2. The current process terminates.
3. A timer interrupt causes the scheduler to run and decide that a process has run for its allotted
interval of time and it is time to move it from the running to the ready state.
Computer Operating System Semester: VII Academic Year: 2024-25
Roll No:
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics Engineering
4. An I/O operation is complete for a process that requested it and the process now moves from
the waiting to theready state. The scheduler may then decide to preempt the currently-running
process and move this ready process into the running state.
The decisions that the scheduler makes concerning the sequence and length of time that processes
may run is called the scheduling algorithm (or scheduling policy). These decisions are not easy ones,
as the scheduler has only a limited amount of information about the processes that are ready to run. A
good scheduling algorithm should:
i. Be fair – give each process a fair share of the CPU, allow each process to run in a reasonable
amount of time.
ii. Be efficient – keep the CPU busy all the time.
iii. Maximize throughput – service the largest possible number of jobs in a given amount of time;
minimize the amount of time users must wait for their results.
iv. Minimize response time – interactive users should see good performance
v. Minimize overhead – don’t waste too many resources. Keep scheduling time and context
switch time at a minimum.
vi. Maximize resource use – favor processes that will use underutilized resources. There are two
motives for this. Most devices are slow compared to CPU operations. We’ll achieve better
system throughput by keeping devices busy as often as possible. The second reason is that a
process may be holding a key resource and other, possibly more important, processes cannot
use it until it is released. Giving the process more CPU time may free up the resource quicker.
vii. Avoid indefinite postponement – every process should get a chance to run eventually.
Implementation details:
Round Robin Algorithm
Computer Operating System Semester: VII Academic Year: 2024-25
Roll No:
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics Engineering
Shortest Remaining Time First Algorithm:
Priority scheduling:
Implementation details: (printout of code)
Post Lab Subjective/Objective type Questions:
Q1 What is Starvation.
Q2 Compare Round robin and SRTF algorithm.
Computer Operating System Semester: VII Academic Year: 2024-25
Roll No:
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics Engineering
Conclusion:
Signature of faculty in-charge with Date:
Computer Operating System Semester: VII Academic Year: 2024-25
Roll No: