Newsgroups: comp.sys.transputer
From: andyr@wizzy.com (Andy Rabagliati)
Subject: Re: OCCAM: Best way to multiplex protocols over one link?
Organization: W.Z.I.
Date: Sat, 30 Apr 1994 06:28:40 GMT
Message-ID: <Cp27Bt.K3n@wizzy.com>

In article <2pr5g8$2ai@mail.fwi.uva.nl>,
Robert Belleman <robbel@fwi.uva.nl> wrote:
>I was wondering; in occam, what do you consider the best way to
>multiplex different process protocols over one link?
>So, something like this:
>
>
>  proc1a ---> +------+     transputer     +------+ ---> proc1b
>  proc2a ---> | muxa | -----------------> | muxb | ---> proc2b
>  proc3a ---> +------+        link        +------+ ---> proc3b
>
>     processor A                          processor B


The hazard with the simple, non-buffered solution is that a message
from proc1a to proc1b can 'block' the link, because proc1b is slow to
read the data.

In that case, no message can get from proc2a to proc2b until it is read.

Furthermore, if the reason proc1b is slow is because it is waiting for a
message from proc2b (channel not shown) we have deadlock.

The easy solution to this is to use the Virtual Channels introduced in
recent versions of the toolset. They do the Right Thing. I think that
they implement (in software) what the T9000 will do in hardware.

To roll your own, you need to do the following. I am only considering
unidirectional communication, a -> b.

1) have an input buffer per process on muxa.

2) have an output buffer per process on muxb.

3) When an output buffer becomes free on muxb, a message is sent to muxa
   to allow a message *for that process* to travel the link, as it is
   guaranteed not to block.
   
This is a simple discussion. For a thorough understanding of the issues
behind deadlock avoidance, look at the literature on the T9000, for
instance unix.hensa.ac.uk:pub/parallel/books/ios/nrat/*. This is a
(large!!) Postscript preprint of a book that is probably now available
in the stores. Details, prices, anyone ?

Cheers,      Andy.

--
The birds have vanished into the sky,	     Andy Rabagliati  andyr@wizzy.com 
   and now the last cloud drains away.			    W.Z.I. Consulting
      We sit together, the mountain and me,
         until only the mountain remains.   -- Li Po (701-762)

