next up previous contents
Next: 3.3.2 Gather-Scatter operations Up: 3.3 Basic global operations Previous: 3.3 Basic global operations   Contents


3.3.1 EXCHANGE

EXCHANGE($ LinkNo$, $ nWords$, $ SendData$, $ RecvData$)

Exchange of data between processes $ p$ and $ q$ via link $ LinkNo$.

Variant a)

Figure 3.12: EXCHANGE non-blocking
\begin{figure}\unitlength0.05\textwidth
\begin{center}
\begin{picture}(9,5)(0,...
...put(6,3.5){\vector(-3,-2){3}}
\thinlines\end{picture} \end{center} \end{figure}

Variant b)

In case of a blocking communication, a deadlock free EXCHANGE between $ p$ and $ q$ needs a unique function determining which one of the two processes may send/receive first. The function BTEST($ k,link$)$  = $XOR( $ k,2^{link 1}$) tests whether the $ link-1$ $ ^{\text{st}}$ bit is set or not. The definition that this process, whose appropriate bit is set first sends and then receives (vice versa on the other process) allows a deadlock-free EXCHANGE procedure.

Figure 3.13: EXCHANGE blocking
\begin{figure}\unitlength0.05\textwidth
\begin{picture}(19,9.5)
%
\savebox{\rb...
...tor(1,0){3}}
\put(11,4){\vector(-1,0){3}}
\thinlines\end{picture} \end{figure}




Gundolf Haase 2000-03-20