0% found this document useful (0 votes)
26 views6 pages

Opareting System

A process can exist in five main states - starting, ready, running, waiting, and terminated. The starting state is when a program is created but not yet running. In the ready state, the process is waiting to be assigned to a CPU. When assigned to a CPU, the process is in the running state. If the process needs to wait for a resource, it enters the waiting state. Finally, when the process completes execution it enters the terminated state.

Uploaded by

Joshua Dzulu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

Opareting System

A process can exist in five main states - starting, ready, running, waiting, and terminated. The starting state is when a program is created but not yet running. In the ready state, the process is waiting to be assigned to a CPU. When assigned to a CPU, the process is in the running state. If the process needs to wait for a resource, it enters the waiting state. Finally, when the process completes execution it enters the terminated state.

Uploaded by

Joshua Dzulu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

THE UNVERSITY OF ZAMBIA

IN ASSOCIATION WITH

MALCOLM MOFFAT COLLEGE OF EDUCATION


Knowledge, Light and Service

SECONDARY TEACHER’S DIPLOMA

NAME: LUPIYA RUTH CLASS: SCSDA3

YEAR OF STUDY: 2023 YEAR: YEAR 3

COURSE: OPERATING SYSTEM DUE DATE:

LECTURE: MR GONDWE R. ASS No: 2

PHONE NO: 0973004773 /0968378331

TASK: A process is said to be a running program that serves as the foundation for all
computation. Explore and state different states that a process can exist in at any given
time. In your exploration, highlight also the process states diagrammatically.
A process is basically a program in execution, or an entity which
represents the basic unit of work to be implemented in the system. In
simpler terms, we write our computer programs in a text file and when
we execute this program, it becomes a process which performs all the
tasks mentioned in the program.

From start to finish, the process goes through a number of stages. A


minimum of five states is required, even though the process could be in
one of these states during execution. 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 five states at a time such
as start, ready, running, waiting and terminated or exit.

Start is the beginning of a process, a new state is where a program just


gets created, and it is an initial state that begins the life cycle of a
process. Without a proper introduction, a program doesn’t stand a
chance to start, this is the state that allows a program to execute at the
right phase. It is the program that is present in secondary memory that
will be picked up by the operating system to create the process, Stallings
and William (2005).

Ready is another state a process goes through, during this phase, the
demand for this program has been brought up, and is hence getting
transformed into a process and kept inside the ready queue. A ready
queue is a place in the primary memory or main memory where all the
processes are kept and which are about to go to the running state.by
default, the process that comes first runs first. Here they are waiting for
their turn to come.
Running is a phase where the ready process is picked up from the ready
queue by CPU, gets assigned to any one of CPU cores and starts to
execute the instruction line. In simpler terms, once the process has been
assigned to a processor by OS scheduler, the process state is set to
running and the processor executes instructions. One of the processes
from the ready state will be chosen by the OS depending on the
scheduling algorithm. Hence, if we have only one CPU in our system, the
number of running processes for a particular time will always be one. If
we have processes running simultaneously.

From the running state, a process can make the transition to the block
or wait state depending upon the scheduling algorithm or the intrinsic
behavior of the process. When a process waits for a certain resource to
be assigned or for the input from the user then the OS move this process
to the block or wait state and assigns the CPU to the other processes.

Completion or termination is when a process finishes its execution, it


comes in the termination state. All the context of the process (process
control block) will be terminated by the operating system.

In addition, Abraham Silberschaz eltal (2008), a process can have


features of moving from running state to the waiting state if it needs to
wait for a resource to become available, it can move from waiting state to
the ready state when the resource it was waiting for becomes available. A
process can move from ready state to running state when it is selected by
the operating system for execution. The scheduling algorithm used by the
operating system determines which process is selected to execute from
the ready state, the operating system may also move a process from the
running state to the ready state to allow other processes to execute.
According to Anenbaum Andrew S (2001), a process can move from
running state to the terminated state when completes its execution, a
process can move from waiting state directly to the terminated state if it
is aborted or killed by the operating system or another process, it also go
through ready, running and waiting state any number of times in its
lifecycle but new and terminated happens only once, the process state
includes information about the program counter, CPU registers, memory
allocation and other resources used by the process, the operating system
maintains a process control block (PCB) for each process, which contains
information about the process state, priority, scheduling information and
other process related data.

The process state diagram is used to represent the transitions between


different states of a process and is an essential concept in process
management in operating system. Below is a diagram representing the
process states.

Start Ready Running Terminated

Wait
A process has merits and demerits too, the merits of a process are that
process state helps to allocate resources more efficiently, proper
management of process state help to prevent crashes and errors, efficient
allocation of CPU time ensures a responsive system and the process
states help us to protect against secure threats and monitoring process
state help us to identify and troubleshoot issues.
The demerits of process state are that the limited number of processes
that can be run simultaneously. Deadlocks can occur in the process and
time, race conditions can cause unpredictable behavior and the use of
process state can increase system complex.
In conclusion, the process states in operating system are used for
managing system resources efficiently. The operating system needs to
keep track of each process’s current state to allocate time, memory and
I/O resources optimally, understanding the different process state can
help developers and system administers design and optimizes systems to
run more efficiently, by managing process state correctly, operating
systems can ensure that the system is responsive, stable and reliable.
REFERENCES

1. Abraham Silberschaz, Peer B. Galvin and Greg Gagne (2008)


operating system concept: Wiley.

2. Maurice J. Bach (1986) He Design of the UNIX Operating


System: Prentice Hall, Inc.

3. Stallings and William (2005). Operating system: internals and


design: principles(5th edition.): prentice hall

4. Anenbaum Andrew S (2001). Modern operating system (2nd


edition): prentice Hall.

You might also like