1.direct communication
–each process wanting to communicate must explicitly name the recipient or sender of the communication
–send and receive primitives defined:
send ( P, message ) : send a message to process P
receive ( Q, message ) : receive a message from process Q
2.indirect communication - messages sent to and received from mailboxes (or ports) »mailboxes can be viewed as objects into which messages placed by processes and from which messages can be removed by other processes
–each mailbox has a unique ID
–two processes can communicate only if they have a shared mailbox
send ( A, message ) : send a message to mailbox A receive
receive ( A, message ) : receive a message from mailbox A
3. synchronization - send and receive operations blocking
»sender is suspended until receiving process does a corresponding read
»receiver suspended until a message is sent for it to receive
- blocking send - when a process sends a message it blocks until the message is received at the destination.
- non blocking send - After sending a message the sender proceeds with its processing without waiting for it to reach the destination.
- blocking receive - When a process executes a receive it waits blocked until the receive is completed and the required message is received.
- non blocking receive - The process executing the receive proceeds without waiting for the message(!).
4. Buffering - the number of messages that can reside in a link temporarily
- Zero capacity - queue length 0 »sender must wait until receiver ready to take the message
- Bounded capacity - finite length queue »messages can be queued as long as queue not full »otherwise sender will have to wait
- Unbounded capacity »any number of messages can be queued - in virtual space? »sender never delayed
5. Producers – Binary semaphores : one message token –General (counting) semaphores : more than one message token –message blocks used to buffer data items –scheme uses two mailboxes »mayproduce and mayconsume
–producer :
»get a message block from mayproduce
»put data item in block
»send message to mayconsume
–consumer :
»get a message from mayconsume
»consume data in block
»return empty message block to mayproduce mailbox
No comments:
Post a Comment