The document discusses various concepts related to process management in operating systems, including process scheduling, interprocess communication, and the structure of process control blocks. It outlines the different states a process can be in, such as new, ready, running, waiting, and terminated, along with the roles of schedulers in managing these states. Additionally, it covers threading models, synchronization issues, and communication mechanisms like semaphores and message passing.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views57 pages
Os Unit 2
The document discusses various concepts related to process management in operating systems, including process scheduling, interprocess communication, and the structure of process control blocks. It outlines the different states a process can be in, such as new, ready, running, waiting, and terminated, along with the roles of schedulers in managing these states. Additionally, it covers threading models, synchronization issues, and communication mechanisms like semaphores and message passing.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 57
ONIT-2
CHapTeR L: process Concept
Cuapren
> process schedultng
— operations on processes
—> Interprocess Communication
— > Communication fo elfen: Server systems:
& 2 MULITHREAD PROGREMITIING
ad Multi threading models
— Thread Ubraries
— “Threading issues
CHAPTER 3 PROCESS SCHEDULING
—> Baste Concepts
> Scheduling criteria
~ Schecluling Algorithms
— > Phutti processor Schedullog,
— Tread Scheduling.
cHepreR «4: INTER Process Communycanon
Race Conditions
cvithcal Regions
Mutual exclusion with busy waiting
Sleep and wakeup
semaphores
Mutezes
Monitors
Message passing
‘Dining. philosophers problem
Readers and writers problem
fletvlituay
Scanned with CamScannerCHopreR 2 : PROCESS Concepr
PROCESS concéor
Tyformaily, a process 13 a Pr9gvar which Is: Onder Execution.
wt Process ig move than a Program Code which i's Sometimes known a3
fext section. a4 also Includes the activity. as Teprésented by the Value oF
Program Counter and the Contents YF Processor Regisers.
>A process generally also tnctudes the process ‘stack which Contatns
Femporory data and a data section which Contains global Variables
yA! process may also Include & heap iI which is a memory ie
dyoamieally allocated to the PROCESS during Uy time.
— > Ne emphasize that the Program by ftselt is not a process,
fsa Passive entity such as a file Containing a tise of
Stored on the dish,
Qounes
@ pragran
instructions
Where as process is an active’ entity with Program
SPediging the next Dnsinuction to’ execube.-
7 P Program becomes a process shen ay executable file Loaded into the
memory
mor sR]
HEAP
DATA
TEXT
PROCESS IN MEMORY
PROCESS srpres:
Aprome?
Scheture ospete
CA Yh
: + fee
event
compe
Ys, # 09 ort»
process se wert =I
Scanned with CamScannerThere are five process states. They are
New *
waiting
Terminated.
(lbiy
=
NEW
In order to execute a. program ».the process has to be created by the
Operating system Once the process i@ Created Jor any pragram then he
will be Considered that the process acquires new State
READY
Qyeer entering Into. the new srates the” processes’ acqiuives the resources:
A ‘Scheduler jg a Spfeware that selects the “Process to be tangferred
from Jobpo0l +0 mainmemoy after acquiring, the resources. Here, Ready
State Can be Considered as mainmemory «
RUNNING STATE
Ajter transferring the process to the ready States again scheduler will
decide Which process has to be send to the processor for execution
The dispatch is responsible for tranaferving the procees from Ready tO
Running state,
Fn Running state, there ave three Coses as Follows -
— Terminated Exit
—+ waiting afo Event
— Totervupts
Terminered
Ff the process executes successfully eolthout ony Interruption Or
to Operation then the process will enter into the terminated state
WAITING:
F any +o operation Occurs then the process will enter fnto
waiting state from vunning State ang soon: After the Completion oF
To operation It gets into ready stare from wasting state
—
Scanned with CamScannerINTERRUPTS:
F 97g Fotersupt occurs, then the process will enter Into Teady state
from running State ang ayter the Completion Of execution YF Tntenupe
fk agatn gets Into the sunning stare from ready State
TREE - STAIE proces
oispmict
Terowints
The process will transfer from ready state to vunning State by dispatcher.
Af the process executes without any alsturbance, then tt terminates
Properly: If an zo operation encounters, then the process wil) get into
the blocked state and Soon after the Completion of t/p it will gee
into ready state a te Process Lime -out then alto the process will enter
Into ready state from running State:
proces? Control Block “t Each’ process fs represented ty O9 by pce
PROCESS SIME
Process tneeer
Feoqenmn comer
Pequstces
POLES CONIEL BLvce pe
Process cO IROL BLOCK (pce)
on)
TASK contort Bock Cre6))
Memory 10 units
st OF open ene
Process Control Block Consists of the solowlng
— process state ____—_—~
Scanned with CamScanner— program counter
— Cpu Regisvers
> SPU. Scheduling Toformation
| > Memory Management Information
> Accounting. Iryomation
| — Fo status Information.
Process STATE :
There are 5 number of States: Tt helps to How that the process fe
Curventy tn which state
PROGREM Counter :
Program Counter Stoves the address of the next Instruction to be
Executed
cpu REGISTERS : .
There are So many registers “Among ase ‘which registers aye Usedt
| Sor Executing the digerent process
CPU ScHeDUUNG InFORMATON:
Cpe scheduling Information, helps to Know tat which process bas to
be executed first based on priority
Memory MANAGEMENT INFORMATION
Memory Management Tyormation tellt about thar each process has
to be allocated to Some memory ie each process should have Base
Address and Limit address
| Aeounring Iv EoRMALON:
Amount oF cpu/Realtime useds Hme Limits. This telle about bow maog
Yesources ane free and how many ane allocated 1 the processes.
Yo STOIUS INFORMATION:
For wbich Process we weed bo execute z/o operation should be
Given by this
Scanned with CamScannerCry snitaing : ;
amen ‘1 sptewen
PROCESS Po
oo eotess pr
eeu, SIVE sme Ip peo
relonp
[
SANE sme Ito pect |
SNE steTE into pe6l |
ae won Fa]
ari
ie ‘eenccevpt/systemm en
oewmlg
is Executing Ip any Fnterrupt occurs the state OF Po will be
Sared 19 PCB and Py undergoes
from PcBy and Comes out of Its
LRE1ono sth1€ _ eeom pce
y
crecv7aG
process po
fale. After that P, veload its state
idle stare and Staves executing. Ut
TeqUbes any To or Interrupt Occurs again. it saves it state into pce) and
Gees toidle: The Po wii) weload Fes state from pcBo and start executing
This Ts called Cpu switching.
PROCESS scHeouung :
SCHEDULING Queve?
whenever the process acquires the vesources, they. wil) be send to Job
Bueue’ from Job Povl.' Based on the memory space of the main memory,
the processes in the 0b guev? wHl) be allocaced the mervory: After
trongferiing ¢0 the' main memory, the process has to be send bo the
Processor for Execution: $0 for Sending a ready queue wii) be
matotained for all the processes present in main memory based om CPU
scheduling algorithms. 30 thar all the process wiil be maintained 10
ready Queue for execution. while executing the process in the
a ed
| processors U any 3/0 operation occurs » again that process wll) be mor
|
Wega ee :
Scanned with CamScannerto the waiting Stare and Queue wil) be maintained there if moettan
one process get3 t/a operation-
then
Yf the processor wants to access the diss ,
the first processes will access tt and Uf more than one process
Tequlres the Same, the Queue will also be raintained here-
QUEUE HEADER PCB) peos
ecnoy [ven] Semel 4
eveve Lan | ReRISTERS oor ed
anegrope [86° TL
unm g [tou [1
pees been Peas
tno tape | EPP
—
ont
pice
uno, (tA
_ 8s
-rertnnna|_ HEAP [— it
dwt Lon
Ready Queue will have @ parts
—+ Head
— Tail
aHead ports to the first Press 0 be executed. where as Tail points
to the bast process
x SD Fon every process there wi) be a Queue maintained at every
‘pevice-
Scanned with CamScanner| __¢jey fines
| $$ Geierty frm
WPI FOR
: ev ncerrup ik
a newlip eveated process will be bepe Into the Teadly Que
ie wap encounter
+ Totianly » ue re wit
wait unt ile turn Comes for ezecuvlon. bile executing,
| diferent Conditions as follows :
Jp an Yo event occurs, it will be placed 19
hos exphed, Te has to terminate and should be Kepe
10 child prowess and ie has to wale for
3/0 Queue: 2p Its time slice
In the ready Queue
sIs the process has to create 0
the execution of that child process
| +
[The process may encounter an intervupt 8
Interwupe to execute and again ie fe sent back to ready Gueue-
0 it has to woit for an
SCHEDULER :
Ah Scheduler 79 a software which Selects the process for bransgerving-
‘here ave three types of schedulers They are
yr tong. term ov Job Scheduler
> Medium term scheduler
+ Short berm .08- Cpu schedulers.
Scanned with CamScanner