Introduction To Operating Systems Processes: By: Syed Waqas Haider
Introduction To Operating Systems Processes: By: Syed Waqas Haider
Processes
By:
Syed Waqas Haider
Department of Computer Sciences,
COMSATS Institute of Information Technology,The Mall
Wah Cantt, Pakistan
Introduction to Processes
• Concept of a process is fundamental to an operating
system
• Can be viewed as an abstraction of a program
– Although to be strict we can say that a program (i.e. an algorithm
expressed in some suitable notation) has a process that
executes the algorithm and has associated with it input, output
and a state.
• Computers nowadays can do many things at the same
time. They can be writing to a printer, reading from a disc
and scanning an image
Introduction to Processes (Contd..)
• The computer (more strictly the operating system) is also
responsible for running many processes, usually, on the
same CPU
• Must give the illusion that the computer is doing many
things at the same time (pseudoparallelism)
• Important to realise
– The CPU is switching processes
– One process can have an effect on another process which is not
currently running.
Process in Memory
A process includes:
program counter
stack
data section
Process State
• 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 (A waiting process is unable
to run until some external event has taken place. For example, it may be waiting for data to be
retrieved from a disc.)
– ready: The process is waiting to be assigned to a process ( A process that is ready is
runnable but cannot get access to the CPU due to another process using it. )
– terminated: The process has finished execution
Program Counter
Stack Pointer
Process State
Process id
• Program
Generated by some condition that occurs as a
result of an instruction execution ,such as
arithmetic overflow ,division by zero ,attempt to
execute an illegal machine instruction.
• Timer
Generated by a timer within the processor. This
allows the os to perform certain function on a
regular basis.
Types of Interrupt
• I/O
Generated by I/O controller, to signal normal
completion of an operation or to signal a variety
of error conditions.
• Hardware failure
Generated by a failure ,such as power or memory
parity error.