0% found this document useful (0 votes)
54 views4 pages

Unit 2 Part 2

Uploaded by

Alieu Keita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views4 pages

Unit 2 Part 2

Uploaded by

Alieu Keita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Unit-2

Process Management
What is Process Scheduling?
Process Scheduling is the process of the process manager handling the removal of
an active process from the CPU and selecting another process based on a specific
strategy.
Process Scheduling is an integral part of Multi-programming applications. Such
operating systems allow more than one process to be loaded into usable memory at a
time and the loaded shared CPU process uses repetition time.
There are three types of process schedulers:
 Long term or Job Scheduler
 Short term or CPU Scheduler
 Medium-term Scheduler

What is Process Scheduling and why needed?


It allows the OS to allocate CPU time for each process. Another important reason to
use a process scheduling system is that it keeps the CPU busy at all times. This
allows you to get less response time for programs.

What is Context Switching?


Considering that there may be hundreds of programs that need to work, the OS must
launch the program, stop it, switch to another program, etc. The way the OS
configures the system to run another in the CPU is called “context switching”. If the
OS keeps context-switching programs in and out of the provided CPUs, it can give
the user a tricky idea that he or she can run any programs he or she wants to run, all
at once.

Objectives of Process Scheduling Algorithm:


 Utilization of CPU at maximum level. Keep CPU as busy as possible.
 Allocation of CPU should be fair.
 Throughput should be Maximum. i.e. Number of processes that complete
their execution per time unit should be maximized.
 Minimum turnaround time, i.e. time taken by a process to finish execution
should be the least.
 There should be a minimum waiting time and the process should not starve
in the ready queue.
 Minimum response time. It means that the time when a process produces
the first response should be as less as possible.

Terminologies to take care of in any CPU Scheduling algorithm?


 Arrival Time: Time at which the process arrives in the ready queue.
 Completion Time: Time at which process completes its execution.
 Burst Time: Time required by a process for CPU execution.
 Turn Around Time: Time Difference between completion time and arrival
time.
Turn Around Time = Completion Time – Arrival Time
 Waiting Time(W.T): Time Difference between turn around time and burst
time.
Waiting Time = Turn Around Time – Burst Time

 CPU utilization: The main purpose of any CPU algorithm is to keep the
CPU as busy as possible. Theoretically, CPU usage can range from 0 to 100 but
in a real-time system, it varies from 40 to 90 percent depending on the system
load.
 Throughput: The average CPU performance is the number of processes
performed and completed during each unit. This is called throughput. The output
may vary depending on the length or duration of the processes.
 Turn round Time: For a particular process, the important conditions are
how long it takes to perform that process. The time elapsed from the time of
process delivery to the time of completion is known as the conversion time.
Conversion time is the amount of time spent waiting for memory access, waiting
in line, using CPU, and waiting for I / O.
 Waiting Time: The Scheduling algorithm does not affect the time required
to complete the process once it has started performing. It only affects the waiting
time of the process i.e. the time spent in the waiting process in the ready queue.
 Response Time: In a collaborative system, turn around time is not the best
option. The process may produce something early and continue to computing the
new results while the previous results are released to the user. Therefore another
method is the time taken in the submission of the application process until the
first response is issued. This measure is called response time.
Types of Process Schedulers
There are three types of process schedulers:

1. Long Term or Job Scheduler

It brings the new process to the ‘Ready State’. It controls the Degree of Multi-
programming, i.e., the number of processes present in a ready state at any
point in time. It is important that the long-term scheduler make a careful
selection of both I/O and CPU-bound processes. I/O-bound tasks are which use
much of their time in input and output operations while CPU-bound processes
are which spend their time on the CPU. The job scheduler increases efficiency
by maintaining a balance between the two. They operate at a high level and
are typically used in batch-processing systems.

2. Short-Term or CPU Scheduler

It is responsible for selecting one process from the ready state for scheduling it
on the running state. Note: Short-term scheduler only selects the process to
schedule it doesn’t load the process on running. Here is when all the scheduling
algorithms are used. The CPU scheduler is responsible for ensuring no starvation
due to high burst time processes.

3. Medium-Term Scheduler

It is responsible for suspending and resuming the process. It mainly does


swapping (moving processes from main memory to disk and vice versa).
Swapping may be necessary to improve the process mix or because a change in
memory requirements has overcommitted available memory, requiring memory
to be freed up. It is helpful in maintaining a perfect balance between the I/O
bound and the CPU bound. It reduces the degree of multiprogramming.
What are the different types of CPU Scheduling Algorithms?

There are mainly two types of scheduling methods:


 Preemptive Scheduling: Preemptive scheduling is used when a
process switches from running state to ready state or from the waiting
state to the ready state.
 Non-Preemptive Scheduling: Non-Preemptive scheduling is
used when a process terminates , or when a process switches from
running state to waiting state.

You might also like