0% found this document useful (0 votes)
52 views

Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems

This document discusses processes and interprocess communication in operating systems. It describes what a process is, the different states a process can be in, and the data structures used to represent processes. Process communication can be either direct, where processes explicitly name each other, or indirect, using mailboxes. Communication links can be established between processes in different ways depending on the communication method. Synchronization between sending and receiving processes can be blocking or non-blocking.

Uploaded by

www.entcengg.com
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems

This document discusses processes and interprocess communication in operating systems. It describes what a process is, the different states a process can be in, and the data structures used to represent processes. Process communication can be either direct, where processes explicitly name each other, or indirect, using mailboxes. Communication links can be established between processes in different ways depending on the communication method. Synchronization between sending and receiving processes can be blocking or non-blocking.

Uploaded by

www.entcengg.com
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Chapter 4: Processes

Process Concept
Process Scheduling
Operations on Processes
Cooperating Processes
Interprocess Communication
Communication in Client-Server Systems

Operating System Concepts

4.1

Silberschatz, Galvin and Gagne 2002

Process Concept
An operating system executes a variety of

programs:

Batch system jobs


Time-shared systems user programs or tasks

Textbook uses the terms job and process

almost interchangeably.
Process a program in execution; process
execution must progress in sequential fashion.
A process includes:
program counter
stack
data section

Operating System Concepts

4.2

Silberschatz, Galvin and Gagne 2002

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.

Operating System Concepts

4.3

Silberschatz, Galvin and Gagne 2002

Diagram of Process State

Operating System Concepts

4.4

Silberschatz, Galvin and Gagne 2002

Process Control Block (PCB)


Each process is represented in OS by
Process Control Block(PCB)
Information associated with each process.
Process state
Program counter
CPU registers
CPU scheduling information
Memory-management information
Accounting information
I/O status information

Operating System Concepts

4.5

Silberschatz, Galvin and Gagne 2002

Process Control Block (PCB)


Process state: The state may be new, ready, waiting,

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.

Operating System Concepts

4.6

Silberschatz, Galvin and Gagne 2002

Process Control Block (PCB)

Operating System Concepts

4.7

Silberschatz, Galvin and Gagne 2002

CPU Switch From Process to Process

Operating System Concepts

4.8

Silberschatz, Galvin and Gagne 2002

Interprocess Communication (IPC)


Mechanism for processes to communicate and

to synchronize their actions.


Message system processes communicate with
each other without resorting to shared variables.
IPC facility provides two operations:
send(message) message size fixed or variable
receive(message)

If P and Q wish to communicate, they need to:


establish a communication link between them
exchange messages via send/receive

Implementation of communication link


physical (e.g., shared memory, hardware bus)
logical (e.g., logical properties)

Operating System Concepts

4.9

Silberschatz, Galvin and Gagne 2002

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?

Operating System Concepts

4.10

Silberschatz, Galvin and Gagne 2002

Direct Communication
Processes must name each other explicitly:
send (P, message) send a message to process P
receive(Q,

message) receive a message from

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.

Operating System Concepts

4.11

Silberschatz, Galvin and Gagne 2002

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

Silberschatz, Galvin and Gagne 2002

Indirect Communication
Operations
create a new mailbox
send and receive messages through mailbox
destroy a mailbox
Primitives are defined as:

send(A, message) send a message to mailbox A


receive(A, message) receive a message from
mailbox A

Operating System Concepts

4.13

Silberschatz, Galvin and Gagne 2002

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.

Operating System Concepts

4.14

Silberschatz, Galvin and Gagne 2002

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.

Operating System Concepts

4.15

Silberschatz, Galvin and Gagne 2002

You might also like