Chapter-Iii Process Management
Chapter-Iii Process Management
OSY - 22516
UNIT-III
PROCESS MANAGEMENT
Mrs. V R Bhivase
POINTS TO BE COVERED
• Introduction to PROCESS
• Process Scheduling
• Inter Process Communication (IPC)
• Threads
• Execute Process Commands
PROCESS
• An operating system executes a variety of programs:
– program counter
– stack
– data section
PROCESS
• PROCESS IN MEMORY
PROCESS STATES
• PROCESS STATES
• As a process executes, it changes state
– new: The process is being created
– running: Instructions are being executed
– waiting: The process is waiting for some event to occur
– ready: The process is waiting to be assigned to a process
– terminated: The process has finished execution
PROCESS STATES
• Process State Diagram (PST)
PROCESS CONTROL BLOCK
• Process control Block
• Each process is represented in the OS by process control
block.
• Also called as task control block.
SWITCH CPU FROM PROCESS TO PROCESS
PROCESS CONTROL BLOCK
• Process state: The process may be new, ready, running,
waiting, halted etc.
• Program counter: It indicates the address of the next
instruction to be executed for this process.
• CPU registers: They includes accumulators, index registers,
stack pointers and general purpose registers. Can save the
interrupted program & resume afterwards.
• CPU-Scheduling information: Process priority information.
• Memory-Management information: Management of memory
consumption.
• Accounting information: Amount of CPU & real time used.
• I/O status information: List of input & output devices.
PROCESS SCHEDULING
• Process scheduling focus on multiprogramming.
• User can interact with each process running on system & can
know the current status (completed, paused or suspended )
remove the process from memory and make space for other processes, the
called swapping, and the process is said to be swapped out or rolled out. Swapping
• Shared memory resides in the address space of the process creating the
shared memory region segment.
• They can exchange information by reading & writing data in shared area.
INTER PROCESS COMMUNICATION
• MESSAGE PASSSING SYSTEM
• There are 3 types of message passing
• 1. Direct communication
– send (Q, message) – send a message to process Q (destination)
– receive(P, message) – receive a message from process P (source)
SOURCE P MESSAGE
SOURCE Q
INTER PROCESS COMMUNICATION
• MESSAGE PASSSING SYSTEM
• 2. Indirect communication
• Messages are directed and received from mailboxes (also referred to as
ports)
• send(Q, message) – send a message to mailbox Q (destination)
• receive(Q, message) – receive a message from mailbox Q (source)
MESSAGE
INTER PROCESS COMMUNICATION
• MESSAGE PASSSING SYSTEM
• 3. Synchronization
• Message passing may be either blocking or non-blocking
TYPES OF THREADS