Lecture 4 Process Management
Lecture 4 Process Management
6
Process Termination
Batch job issues stop instruction
User logs off
Process executes a service request to terminate
Error and fault conditions
Normal completion
Time limit exceeded
Memory unavailable
Others…
7
Process States
Processes change state during their execution,
sometimes by themselves (e.g. by making a system
call), and sometimes due to an external event (e.g.
when the CPU gets a timer interrupt).
READY, RUNNING and BLOCKED
once a process is created, it can stay in of the three
states
8
Process State Transition
dispatch
ready
Pre-empt terminated
Event done run
9
Types of Processes
Foreground Process
Background Process
I/O-bound process – spends more time doing
I/O than computations, many short CPU
bursts
CPU-bound process – spends more time
doing computations; few very long CPU
bursts
10
Process Concurrency: Terms
Multitasking — having multiple processes
time slice on the same processor.
Multiprogramming —having multiple jobs in
the system(either on the same processor, or on
different processors)
Multiprocessing — using multiple processors
for the same job or system (i.e. parallel
computing).
11
Multiprogramming
a system executing many processes concurrently
multiple processes are handled by the system at the
same time, typically by time slicing
requires that the processor be allocated to each
process for a period of time and de-allocated at an
appropriate moment
The stopping of one process and starting (or
restarting) of another process is called a context
switch.
12
Why use multiprogramming?
to improve responsiveness, which means that users
will have to wait less (on average) for their jobs to
complete
to improve hardware utilization
Applications use one system component at a time
allows for simultaneous use of several components
allows for concurrent programming, in which the
multiple processes interact to work on the same
problem
13