Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems
Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems
Process Concept
Process Scheduling
Operations on Processes
Cooperating Processes
Interprocess Communication
Communication in Client-Server Systems
4.1
Process Concept
An operating system executes a variety of
programs:
almost interchangeably.
Process a program in execution; process
execution must progress in sequential fashion.
A process includes:
program counter
stack
data section
4.2
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.
ready: The process is waiting to be
assigned to execution..
terminated: The process has finished
execution.
4.3
4.4
4.5
halted and so on
Program Counter: Program counter indicates address
of next instruction
CPU registers: It includes Accumulator, index register,
general purpose register
CPU scheduling information
Memory-management information
Accounting information: This includes amount of CPU
used job or process number .
I/O status information: It gives list of I/O devices allocated
to process.
4.6
4.7
4.8
4.9
Implementation Questions
How are links established?
Can a link be associated with more than two
processes?
How many links can there be between every
pair of communicating processes?
What is the capacity of a link?
Is the size of a message that the link can
accommodate fixed or variable?
Is a link unidirectional or bi-directional?
4.10
Direct Communication
Processes must name each other explicitly:
send (P, message) send a message to process P
receive(Q,
process Q
Properties of communication link
Links are established automatically.
A link is associated with exactly one pair of
communicating processes.
Between each pair there exists exactly one link.
The link may be unidirectional, but is usually bidirectional.
4.11
Indirect Communication
Messages are directed and received from mailboxes (also
referred to as ports).
Each mailbox has a unique id.
Processes can communicate only if they share a
mailbox.
Properties of communication link
Link established only if processes share a common
mailbox
A link may be associated with many processes.
Each pair of processes may share several
communication links.
Link may be unidirectional or bi-directional.
Operating System Concepts
4.12
Indirect Communication
Operations
create a new mailbox
send and receive messages through mailbox
destroy a mailbox
Primitives are defined as:
4.13
Indirect Communication
Mailbox sharing
P1, P2, and P3 share mailbox A.
P1, sends; P2 and P3 receive.
Who gets the message?
Solutions
Allow a link to be associated with at most two
processes.
Allow only one process at a time to execute a receive
operation.
Allow the system to select arbitrarily the receiver.
Sender is notified who the receiver was.
4.14
Synchronization
Message passing may be either blocking or
non-blocking.
Blocking is considered synchronous
Non-blocking is considered asynchronous
send and receive primitives may be either
blocking or non-blocking.
4.15