presentation source
Download
Report
Transcript presentation source
Process Description
and Control
Process concepts
Definitions
replaces task, job
– program in execution
– entity that can be assigned to and executed on
a processor
–
Process states
running
– ready
– blocked
–
The main responsibility of an OS is to
control the execution of processes
OS objectives and processes
Operating systems must interleave the
execution of a number of processes
to maximize processor use
– while providing reasonable response rate
–
Operating systems must allocate resources to
processes
based on priorities
– while avoiding deadlock
–
Operating systems may support
interprocess communications
– user creation of processes
–
A two-state process model
Dispatch
Enter
Exit
Not
running
Running
Pause
Process creation
–
–
–
–
new batch job
interactive login
OS created to provide a service
spawned by existing process
Process termination
–
–
normal completion
abnormal end (abend)
time related
protection error
program error
data error
I/O failure
memory error
Process state transitions with suspend
and resume
I/O or event completion
Blocked
Dispatch
Ready
A
C
T
I
V
E
I/O or event
wait
Timerrunout
Running
Suspend
Suspend
Resume
Suspended
ready
Suspend
I/O or event completion
Resume
Suspended
blocked
SWAPPED
Other related concepts
Suspend and swapping
not immediately available
– may or may not be waiting for event or I/O
– blocked may be independent of suspend
– process was placed on suspend by an agent
–
OS and processes
the OS schedules and dispatches processes for
execution by the processor, and allocates
resources to processes
– OS is the entity that manages the use of system
resources by processes
–
OS control structures
What does the OS needs (a) to be able to control
processes and (b) manage resources for them?
memory tables
– I/O tables
– file tables
– process tables
–
These tables are maintained by the OS
How does it know what and how to create?
–
Initialization and configuration
Process control structures
What is the physical manifestation of a
process?
a program or set of programs
– a set of data locations for variables and
constants
– memory to hold programs and data
– stack for procedure calls, parameter passing
–
PCB - Process Control Block
entity that defines a process to the OS
– collection of process attributes: process
identification, processor state and process
control information.
–
OS core, kernel or supervisor
Execution modes: system or user modes
OS core or kernel
Process management
process creation and termination
process scheduling and dispatching
process switching
process synchronization and support for
inter-process communication
management of PCBs
– Memory management
– I/O management
– Support functions
–
Is the Operating System a process?
1. No,
separate
P1 P2 P3 . . . . Pn
Kernel
P 1 P 2 P3
Pn
....
2.No,
subroutines
3.Yes
OS OS OS
OS
Process switching
U1 U2
U3
....
Un
O1
O2
Process switching
O3
....
On
Processes and Threads
Process is a unit of:
resource ownership
– dispatching
–
Threads
only an unit of dispatching
– inside a process
– saves time to create, switch and terminate
–
A good example: a file server process
each request as a thread
– the process spawn the threads
–