CH 03 - Process Description and Controls
CH 03 - Process Description and Controls
Systems:
Internals
and Design
Principles Process Description
and Control
A computer platform The OS was developed to
consists of a collection provide a convenient,
of hardware resources feature-rich, secure, and
consistent interface for
Computer applications applications to use
are developed to
perform some task
We can think of the OS as
providing a uniform,
It is inefficient for abstract representation of
applications to be
written directly for a resources that can be
given hardware platform requested and accessed by
applications
OS Management of
Application Execution
Resources are made available to multiple
applications
Theprocessor is switched among multiple
applications so all will appear to be
progressing
Theprocessor and I/O devices can be
used efficiently
Process Elements
Two essential elements of a process are:
Program code
which may be shared with other processes that are executing
the same program
identifier
program
state priority
counter
Context data
Process
Dispatcher
5000
Execution 8000
Process A
Process B
12000
Process C
Dispatch
Pause
Queue
Enter Dispatch Exit
Processor
Pause
Event
Occurs Event
Wait
Blocked
Process B
Process C
Dispatcher
0 5 10 15 20 25 30 35 40 45 50
Timeout
Blocked Queue
Event Event Wait
Occurs
(a) Single blocked queue
Timeout
Event 1 Queue
Event 1 Event 1 Wait
Occurs
Event 2 Queue
Event 2 Event 2 Wait
Occurs
Event n Queue
Event n Event n Wait
Occurs
when none of the processes in main memory is in the Ready state, the
OS swaps one of the blocked processes out on to disk into a suspend
queue
(a) With One Suspend State
New
Ad
t
Dispatch
mi
Admit Release
mi
Ad
New Ready Suspend Running Exit
t
Timeout
Activate Dispatch
Ready/ Release
it
Ready Running Exit
Occurs Occurs
a
e
Event Event
at
tW
Suspend
iv
Suspend Timeout
ct
t W ven
A
t
ai
Occurs
Event
Suspend
en
Suspend Blocked
Ev
Activate
Blocked/
Suspend (a)Blocked
With One Suspend State
Suspend
mi
Ad
Suspe
t
nd
(a) With One Suspend State
New
Ad
t
mi
mi
Ad
Suspe
t
nd
Activate Dispatch
Ready/ Release
Suspend Ready Running Exit
Suspend Timeout
t
ai
Occurs
Occurs
Event
Event
tW
en
Ev
Activate
Blocked/
Suspend
Blocked
Suspend
Computer
Resources
Main
Processor I/O I/O I/O
Memory
Figure 3.10 Processes and Resources (resource allocation at one snapshot in time)
Process
Image
Memory Tables
Process
Memory 1
Files
Process 1
Process 2
Process
Process 3 Image
Process
n
Process n
User Data
The modifiable part of the user space. May include program data, a user stack area, and
programs that may be modified.
User Program
The program to be executed.
Stack
Each process has one or more last-in-first-out (LIFO) stacks associated with it. A stack is
used to store parameters and calling addresses for procedure and system calls.
Ready
Blocked
Kernel
Operating P1 P2 Pn
System
OS OS OS
Func- Func- Func-
tions tions tions
P1 P2 Pn OS1 OSk
Process description
Operating system control structures
Process control structures