Message Passing part3

Inter-Process Communication

Posted on Updated on

Producer-Consumer

clip_image002

• Consumer sends N empty messages (i.e., slots)

• Producer picks up an empty message/slot and send back an item produced

• Consumer receives an item and sends back an empty message (i.e., a slot)

• Messages sent, but not received are buffered by OS

Characteristics

Naming: Direct Communication

• Sender/receiver refer to each other, as seen before

• Properties of communication link

– Link is established automatically between communicating processes

– Link is associated with exactly two processes

–Exactly one link for every pair of processes

• Communication is symmetric(above) or asymmetric

– send(P,m) // send a message to P

– receive(&id, m) // receive from any process, set id to sender

Direct Naming

clip_image004

Naming: Indirect Communication

• Communication via mailboxes (or ports)

• Processes communicate by putting and taking messages in/from mailboxes

–send(A, m)and receive(A,m)

• Properties of communication link

– A link is established between two processes, if they share a mailbox

– Link maybe associated with more than two processes

– A number of different links may exist between any pair of processes; each one a separate mailbox

Indirect Naming

clip_image006

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements