0% found this document useful (0 votes)
49 views23 pages

Unit - 1 Process Management - PPT

The document discusses process management in operating systems. It defines a process as a program in execution that contains code, activity, and resources. The operating system allocates resources to processes and enables sharing between processes. Process scheduling involves removing a running process from the CPU and selecting another based on strategies. There are different queues like ready and I/O queues. Scheduling considers criteria like priority and algorithms like first come first serve.
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)
49 views23 pages

Unit - 1 Process Management - PPT

The document discusses process management in operating systems. It defines a process as a program in execution that contains code, activity, and resources. The operating system allocates resources to processes and enables sharing between processes. Process scheduling involves removing a running process from the CPU and selecting another based on strategies. There are different queues like ready and I/O queues. Scheduling considers criteria like priority and algorithms like first come first serve.
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/ 23

Operating System - II

Unit -1 Process Management

Prepared By :- Eeva Kapopara


1 SDJ International College
Agenda
 Process Concept
 Process Scheduling
 Scheduling Criteria
 Scheduling Algorithms

Prepared By :- Eeva Kapopara


2 SDJ International College
What is Process?
 A process may be termed as an instance of a computer program
that is being executed. It contains the program code and its
current activity.
 A program in execution
 The entity that can be assigned to and executed on a processor
 A unit of activity characterized by the execution of a sequence
of instructions, a current state and an associate set of system
resources
 The OS must allocate resources to processes, enable processes to
share and exchange information, protect the resources of each
process from other processes and enable synchronization among
processes

3 Prepared By :- Eeva Kapopara


Process control block
Identifier

State

Priority

Program Counter

Memory pointer

CPU Registers

I/O status Information

Accounting information

………………
4 Prepared By :- Eeva Kapopara
1 Process State
The current state of the process i.e., whether it is ready, running, waiting, or whatever.
2 Process ID
Unique identification for each of the process in the operating system.
3 Priority
Priority amongst the many processes is stored.
4 Program Counter
Program Counter is a pointer to the address of the next instruction to be executed for this
process.
5 CPU registers
Various CPU registers where process need to be stored for execution for running state.
6 Memory management information
This includes the information of page table, memory limits, Segment table depending on
memory used by the operating system.
7 Accounting information
This includes the amount of CPU used for process execution, time limits, execution ID
etc.
8 IO status information
This includes a list of I/O devices allocated to the process.

5 Prepared By :- Eeva Kapopara


Process States

6 Prepared By :- Eeva Kapopara


Agenda
 Process Concept
 Process Scheduling
 Scheduling Criteria
 Scheduling Algorithms

7 Prepared By :- Eeva Kapopara


Process Scheduling
 The process scheduling is the activity of the process manager
that handles the removal of the running process from the CPU
and the selection of another process on the basis of a particular
strategy.
 Process scheduling is an essential part of a multiprogramming
operating system. Such operating systems allow more than one
process to be loaded into the executable memory at a time and
loaded process shares the CPU using time multiplexing.

8 Prepared By :- Eeva Kapopara


Scheduling queues
 Scheduling queues refers to queues of processes or devices.
 This figure shows the queuing diagram of process scheduling.
 Queue is represented by rectangular box.
 The circles represent the resources that serve the queues.
 The arrows indicate the process flow in the system.

9 Prepared By :- Eeva Kapopara


 Queues are of two types
 Ready queue :A newly arrived process is put in the ready
queue. Processes waits in ready queue for allocating the CPU
 Device queue : Device queue is a queue for which multiple
processes are waiting for a particular I/O device. Each device
has its own device queue.
 While executing the process, any one of the following events can
occur.
 The process could issue an I/O request and then it would be
placed in an I/O queue.
 The process could create new sub process and will wait for its
termination.
 The process could be removed forcibly from the CPU, as a
result of interrupt and put back in the ready queue.

10 Prepared By :- Eeva Kapopara


Two state process model
 Two state process model refers to running and non-running
states.
 Running : When new process is created by Operating System
that process enters into the system as in the running state.
 Not Running : Processes that are not running are kept in
queue, waiting for their turn to execute.
 Each entry in the queue is a pointer to a particular process.
Queue is implemented by using linked list. When a process
is interrupted, that process is transferred in the waiting
queue. If the process has completed or aborted, the process
is discarded. In either case, the dispatcher then selects a
process from the queue to execute.

11 Prepared By :- Eeva Kapopara


Scheduler
 Schedulers are special system softwares.
 Their main task is to select the jobs to be submitted into the
system and to decide which process to run.
 Schedulers are of three types
 Long Term Scheduler
 Short Term Scheduler
 Medium Term Scheduler

12 Prepared By :- Eeva Kapopara


Long term scheduler
 It is also called job scheduler.
 Long term scheduler determines which programs are admitted to
the system for processing.
 Job scheduler selects processes from the queue and loads them
into memory for execution.
 Process loads into the memory for CPU scheduling.
 The primary objective of the job scheduler is to controls the
degree of multiprogramming.
 On some systems, the long term scheduler may not be available
or minimal. Time-sharing operating systems have no long term
scheduler. When process changes the state from new to ready,
then there is use of long term scheduler

13 Prepared By :- Eeva Kapopara


Short term scheduler
 It is also called CPU scheduler.
 Main objective is increasing system performance in accordance
with the chosen set of criteria.
 It is the change of ready state to running state of the process.
 CPU scheduler selects process among the processes that are
ready to execute and allocates CPU to one of them.
 Short term scheduler also known as dispatcher, execute most
frequently and makes the fine grained decision of which process
to execute next. Short term scheduler is faster than long term
scheduler.

14 Prepared By :- Eeva Kapopara


Medium term scheduler
 Medium term scheduling is part of the swapping.
 It removes the processes from the memory.
 It reduces the degree of multiprogramming.
 The medium term scheduler is in-charge of handling the
swapped out-processes.
 Running process may become suspended if it makes an I/O
request. Suspended processes cannot make any progress towards
completion. In this condition, to remove the process from
memory and make space for other process, the suspended
process is moved to the secondary storage. This process is called
swapping, and the process is said to be swapped out or rolled
out. Swapping may be necessary to improve the process mix.

15 Prepared By :- Eeva Kapopara


Comparison between scheduler
Sr. Long Term Scheduler Short Term Scheduler Medium Term Scheduler
No.
1 It is a job scheduler It is a CPU scheduler It is a process swapping
scheduler.
2 Speed is lesser than short Speed is fastest among Speed is in between both
term scheduler other two short and long term
scheduler.

3 It controls the degree of It provides lesser control It reduces the degree of


multiprogramming over degree of multiprogramming.
multiprogramming
4 It is almost absent or It is also minimal in time It is a part of Time sharing
minimal in time sharing sharing system systems.
system
5 It selects processes from It selects those processes It can re-introduce the
pool and loads them into which are ready to execute process into memory and
memory for execution execution can be continued.
16
Prepared By :- Eeva Kapopara
Agenda
 Process Concept
 Process Scheduling
 Scheduling Criteria
 Scheduling Algorithms

17 Prepared By :- Eeva Kapopara


Scheduling
policies

Non- pre emptive Pre emptive

Non- pre emptive

18 Prepared By :- Eeva Kapopara


Scheduling criteria
 There are several different criteria to consider when trying to select the
"best" scheduling algorithm for a particular situation and environment,
including:
 CPU utilization - Ideally the CPU would be busy 100% of the time, so
as to waste 0 CPU cycles. On a real system CPU usage should range
from 40% ( lightly loaded ) to 90% ( heavily loaded. )
 Throughput - Number of processes completed per unit time. May range
from 10 / second to 1 / hour depending on the specific processes.
 Turnaround time - Time required for a particular process to complete,
from submission time to completion. ( Wall clock time. )
 Waiting time - How much time processes spend in the ready queue
waiting their turn to get on the CPU.
 Response time - The time taken in an interactive program from the
issuance of a command to the commence of a response to that command.
 In general one wants to optimize the average value of a criteria ( Maximize
CPU utilization and throughput, and minimize all the others. )

19 Prepared By :- Eeva Kapopara


Agenda
 Process Concept
 Process Scheduling
 Scheduling Criteria
 Scheduling Algorithms

20 Prepared By :- Eeva Kapopara


Process scheduling policies
 FCFS (First Come First Serve) Scheduling
 Shortest-Job-First (SJF) / Shortest Job Next (SJN) Scheduling
 Priority Scheduling
 Round Robin(RR) Scheduling
 Multilevel Queue Scheduling

Note:
 In each and every policy have to found waiting time, turn around time, average
waiting time and average turn around time
 Non pre emptive policy:
Waiting time = Response time – arrival time
or Turn around time – Burst time
Turn around time = Completion time – arrival time
or = waiting time + burst time
 Pre emptive policy:
Waiting time = Latest Response time – arrival time – seconds already
executed
or Turn around time – Burst time
Turn around time = Completion time – arrival time
or waiting time + burst time

21 Prepared By :- Eeva Kapopara


Multilevel queue scheduling
 Multi level queue scheduling was created for situation in which
processes are easily classified into different groups.
 characteristics:
 Processes are divided into different queue based on their type.
Process are permanently assigned to one queue, generally
based on some property of process i.e. system process,
interactive, batch system, end user process, memory size,
process priority and process type.
 Each queue has its own scheduling algorithm. For example
interactive process may use round robin scheduling method,
while batch job use the FCFS method.

22 Prepared By :- Eeva Kapopara


 In addition, there must be scheduling among the queue and is
generally implemented as fixed priority preemptive scheduling.
Foreground process may have higher priority over the
background process

23 Prepared By :- Eeva Kapopara

You might also like