Process Management: Operating Systems
Process Management: Operating Systems
Prof J P Misra
BITS, Pilani
Max
Stack
Heap
Data
Text
0
3
3 Operating Systems BITS Pilani, Pilani Campus
Process creation
• Process Is created
– When a new job is submitted
– When a user attempts to login
– to provide a service
• Process can be spawned by existing process
Operating Systems 6
6 Operating Systems BITS Pilani, Pilani Campus
Memory Layout
Program Counter
Dispatcher
Process A
Process C
Process B
D P1 D P2 D P3
Queue P0
Exit
Enter Dispatch
P3 P2 P1 Processor
Pause
Dispatch
Admit Release
Ready Running
Time Out
Blocked
Queue
Exit
Enter Dispatch
Processor
Pause
Blocked Queue
Queue
Exit
Enter Dispatch
Processor
Pause
Event 1 Queue
Event n Queue
Dispatch
Admit Release
NEW Ready Running Exit
Time Out
Blocked
• New to ready
• Ready to running
• Running to exit
• Running to ready
• Running to blocked
• Blocked to ready
• Ready to exit
• Blocked to exit
20 Operating Systems BITS Pilani, Pilani Campus
Consider a scenario
Q. What do we do ?
Ans. Swapping
• Blocked Blocked/suspended:
– If Ready queue is empty and insufficient memory
is available then one of the blocked process can be
swapped out
– If currently running process requires more memory
• Ready Ready/Suspend
– Normally a blocked process is suspended
– Suspend Ready process if it is the only way to free
memory
– Suspend a lower priority ready process than higher
priority blocked process ?
• Blocked Suspended Blocked
• Running Ready suspended
• Various Exit
Operating Systems 27
27 Operating Systems BITS Pilani, Pilani Campus
Process Management
Prof J P Misra
BITS, Pilani
8
7
1
3 5
9 4 6
• File Table
– Provide information about
– Existence of file
– Location on secondary memory
– Current status and attributes of file
• Process table
– keep track of processes
Operating Systems 38
38 Operating Systems BITS Pilani, Pilani Campus
Operating Systems Control table
I/O Table
I/O devices
File File Table Process1
Processes
Memory Process 1
Process 2
Process 3
Process n
Memory Table
Process n
• Process identification
• Processor State Information
• Processes control information
• Process Management
– Process creation & termination
– Process scheduling & dispatching
– Process switching
– Process synchronization & support for IPC
– Management of process control block
• Memory Management
– Allocation of address space to process
– Swapping
– Page & segment management
46 Operating Systems BITS Pilani, Pilani Campus
Functions of OS kernel Cont…
• I/O Management
– Buffer management
– Allocation of I/O channels & devices to processes
• Support Services
– Interrupt handling
– Accounting
– monitoring
Operating Systems 48
48 Operating Systems BITS Pilani, Pilani Campus