Thursday, July 30, 2009

operating system 4

Interprocess Communication
-Inter-process communication (IPC) is a set of techniques for the exchange of data among multiple
threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC techniques are divided into methods for message passing, synchronization, shared memory, and remote procedure calls (RPC). The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated.
-Derict 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 bi-directional
-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
-Synchronization
- Message passing may be either blocking or non-blocking

*Blocking send has the sender block until the message is received
*Nonblocking send
-Non-blocking send has the sender send the message and continue
*blocking recieve
- Blocking receive has the receiver block until a message is available
*Nonblocking recieve
-Non-blocking receive has the receiver receive a valid message or null

Buffering
*Zero capacity - 0 messagesSender must wait for receiver (rendezvous)
*Bounded Capacity - finite length of n messagesSender must wait if link full
*Unbounded Capacity- infinite length Sender never waits

Producer
*producer

a person who produces.
*consumer
a person or thing that consumes.

No comments: