Process-Management
Process-Management
Process States:
When a process executes, it passes through
different states. These stages may differ in
different operating systems.
SSMPTC Page 2 of 31
Operating System Handout
Process State
Diagram Process Control
Block (PCB):
A Process Control Block is a data
3.2 Process
Scheduling
Definition
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
SSMPTC Page 7 of 31
Operating System Handout
SSMPTC Page 8 of 31
Operating System Handout
SSMPTC Page 9 of 31
Operating System Handout
SSMPTC Page 15 of 31
Operating System Handout
Context Switch:
A context switch is the mechanism to
store and restore the state or context of a
CPU in Process Control block so that a
process execution can be resumed from
the same point at a later time.
Program Counter
Scheduling information
Base and limit register value
Currently used register
SSMPTC Page 17 of 31
Operating System Handout
Changed State
I/O State information
Accounting information
SSMPTC Page 18 of 31
Operating System Handout
SSMPTC Page 20 of 31
Operating System Handout
primitives:
send(message,
destinaion) or
send(message)
receive(message,
host) or
receive(message)
SSMPTC Page 21 of 31
Operating System Handout
SSMPTC Page 24 of 31
Operating System Handout
SSMPTC Page 26 of 31
Operating System Handout
SSMPTC Page 27 of 31
Operating System Handout
Advantages
Thread switching does not require
Kernel mode privileges.
User level thread can run on any
operating system.
Scheduling can be application specific
in the user level thread.
User level threads are fast to create and
manage.
Disadvantages
In a typical operating system, most
system calls are blocking.
Multithreaded application cannot take
advantage of multiprocessing.
Kernel Level Threads
In this case, thread management is done by
the Kernel. There is no thread management
code in the application area. Kernel
threads are supported directly by the
operating system. Any application can be
programmed to be multithreaded. All of
the threads within an application are
supported within a single process.
The Kernel maintains context information
for the process as a whole and for
individuals threads within the process.
Scheduling by the Kernel is done on a
thread basis. The Kernel performs thread
creation, scheduling and management in
Kernel space. Kernel threads are generally
SSMPTC Page 28 of 31
Operating System Handout
SSMPTC Page 29 of 31
Operating System Handout
SSMPTC Page 30 of 31
Operating System Handout
SSMPTC Page 31 of 31