next up previous contents
Next: 3.2.2.3 Monitor concept Up: 3.2.2 Semaphores Previous: 3.2.2.1 Concept of semaphores   Contents

3.2.2.2 Message Passing

The message passing is a mechanism transfering data directly from one process to a another one. We distinguish in the Message Passing ($ =$ communication) between synchronous and asynchronous communication :

Figure 3.9: Blocking communication
\begin{figure}\begin{center}
\unitlength0.07\textwidth
\begin{picture}(6,4)
\...
...1,0){0.4}}
\put(3.9,2){\vector(1,0){0.5}}
\end{picture}\end{center}\end{figure}

In the blocking communication, all (often 2) involved processes wait until all processes signaled their readiness for data/message exchange.
The following communication acts for processes $ P_1$ and $ P_2$ like 2 semaphores :
$ \bullet$ V($ P_1$) : Ready for SEND
$ \bullet$ P($ P_1$) : Wait until $ P_1$ is ready to receive.
$ \bullet$ V($ P_2$) : Ready for RECV
$ \bullet$ P($ P_2$) : Wait until $ P_2$ is ready to send.


Figure 3.10: Non-blocking communication
\begin{figure}\begin{center}
\unitlength0.07\textwidth
\begin{picture}(6,4)
\...
...}}
%
\put(1.5,3){\vector(1,0){2.9}}
%
\par\end{picture}\end{center}\end{figure}

In the non-blocking, all processes send or receive their data totally independent from the status of the remaining processes. The semaphore concept is typical for shared memory computers wherein the resource management is usually unnoticed by the programmer. On the other hand, the message passing occurs on distributed memory computers and must be completed at least partially by the programmer.
next up previous contents
Next: 3.2.2.3 Monitor concept Up: 3.2.2 Semaphores Previous: 3.2.2.1 Concept of semaphores   Contents
Gundolf Haase 2000-03-20