Process Management

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

The Process Model

Process models are processes of the same nature that are classified
together into a model. Thus, a process model is a description of a process
at the type level. Since the process model is at the type level, a process is
an instantiation of it.
Process States Life Cycle/Process states
When a process executes, it passes through different states. These stages
may differ in
different operating systems, and the names of these states are also not
standardized.
In general, a process can have one of the following states
1. five states model

1New- This is the initial state when a process is first started/created.


2 Ready The process is waiting to be assigned to a processor. Ready
processes are waiting to have the processor allocated to them by the
operating system so that they can run. Process may come into this state
after Start state or while running it by but interrupted by the scheduler to
assign CPU to some other process.
3 Running Once the process has been assigned to a processor by the OS
scheduler, the process state is set to running and the processor executes
its instructions.
4 Waiting Process moves into the waiting state if it needs to wait for a
resource, such as waiting for user input, or waiting for a file to become
available.
5 Terminated or Exit Once the process finishes its execution, or it is
terminated by the operating system, it is moved to the terminated state
where it waits to be removed from main memory.
2. Three state model
NB: blocked is also referred to as suspended/waiting

3. Two state model

Suspended process
Process is said to be suspended when it's temporarily move from main
memory to secondary storage.
Reasons why a process is suspended includes:
Swapping: OS needs to release required main memory to bring in a
process which is ready to execute.

Timing: Process can be suspended while waiting for the next time interval.

Interactive user request: Process can be suspended for debugging purpose


by user.

Parent process request: To modify suspended process or to coordinate


activity of several descendants.

Characteristics of a suspended process.


1) the process is not immediately available for execution
2) the process may or may not be waiting on an event
3) The process was placed in a suspended state by an agent
4) the process may not be removed from this state until the agent explicitly
orders the removal
Operations of a process
The various operations that can be done on a process are:
a. Process creation
b. Destroy a process
c. Run a process
d. Change process priority
e. Get process information
f. Set process information

The 2 main operations include:


1. Process creation
It's the job of the OS to create processes. There are many ways of achieving
this(reasons for process creation)
I. For a batch environment - A process is created in response to submission of a
job.
II. In an interactive environment - a process is created when a new user attempt to
log in
III. The OS can create a process to perform a task on behalf of user program
IV. A number of processes can be created from the main process

2. Process termination
There are 2 types of termination
A. Normal termination
a process is done or has completed whatever it was supposed to do and
executes an exit system call
It returns an output data to its parent process
All resources allocated to a process are freed by it at this time.
B. Forced termination
It's done by its parent process when it executes an abort system call. When a
parent process terminates the child process is also automatically terminated.

Reasons for forced termination


a. The child process has exceeded allocated resources
b. Task assigned to child is no longer required
c. Parent is terminating and OS does not allow child to continue that is called
cascading termination.
d. Expiration of time slice slot
e. Memory boundary violation
f. I/O failure

Cooperating process
Two process are said to be serial if the execution of one must be completed before the
execution of another process can start.
Two processes are said to be concurrent if their execution can overlap in time
A process which executes concurrently (parallel) and affect or get affected by another
process when data sharing or other resource sharing.
NB. Any process which shares data with other processes is a cooperating process.

You might also like