Lecture 06
Lecture 06
DISTRIBUTED COMPUTING
Lecture 06
By
Mr. Sheraz Babar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Direct Communication (1)
Naming
• Processes that want to communicate must have a way to refer to each
other
• They use either direct or indirect communication
• Under direct communication each process must explicitly name the
receipt or sender of the communication
• Send (P, message) meaning send a message to process P
• Receive (Q, message) meaning receive a message from process Q
Direct Communication (2)
• Communication between processes takes place through calls to send() and receive()
primitives.
• There are different design options for implementing each primitive
• Message passing may be either blocking or nonblocking- also known as synchronous
and asynchronous
• Block Sending:
• The sending process is blocked until the message is received by the receiving process or by the
mailbox
• Nonblocking Send:
• The sending process sends the message and resumes operation
• Blocking Receive:
• The receiver blocks until the message is available
• Nonblocking Receive:
• The receiver retrieves either a valid message or a null
Buffering (1)
Bounded Capacity
• The queue has a finite length n, thus at most n messages can reside in
it
• If the queue is not full when a new message is sent, the message is
placed in the queue and the sender can continue execution without
waiting
• The link capacity is finite, however, if the link is full, the sender must
block until space is available in queue
Buffering (3)
Unbounded Capacity
• The queues length is potentially infinite, thus any number of
messages can wait in it
• The sender never blocks
The End
34