
Programming Using the
Message-Passing
Paradigm I
Dr. Cem Özdo
˘
gan
LOGIK
Programming Using
the Message-Passing
Paradigm
Principles of
Message-Passing
Programming
Structure of
Message-Passing
Programs
The Building Blocks: Send
and Receive Operations
Blocking Message Passing
Operations
Non-Block ing Message
Passing Operations
5.13
Blocking Message Passin g Operations VI
•
On a send operation, the sender simply copies the data
into the designated buffer and returns after the copy
operation has been completed.
•
The sender process can now continue with the program
knowing that any changes to the data will not impact
program semantics.
•
Note that at the receiving end, the data cannot be stored
directly at the target location since this would violate
program semantics.
•
Instead, the data is copied into a buffer at the receiver as
well.
•
When the receiving process encounters a receive
operation, it checks to see if the message is available in its
receive buffer. If so, the data is copied into the tar get
location.
•
In general, if the parallel program is highly synchronous,
non-buffered sends may perform better than buffer ed
sends.
•
However, generally, this is not the case and buffer ed sends
are desirable unless buffer capacity becomes an issue.