Newsgroups: comp.sys.transputer
From: Gene Clendon <clendon@bnr.ca>
Subject: Re: Please help with Occam/tranputers
Organization: My own
Date: Thu, 17 Mar 1994 23:32:23 GMT
Message-ID: <1994Mar17.233223.26825@bnr.ca>

In article <1994Mar17.073111.7166@bnr.ca> Gene Clendon, clendon@bnr.ca
writes:
>When communicating on channels, the process will hold until that
>communication is complete.  If the receiver is expecting more than what
>is sent, it will deadlock.
>One way to avoid the receiving problem is to place a timer into an ALT
>with the receive, so that if no communication reaches the channel after a
>set time, the 'ALT times out' so to speak and carries on with the job at
>hand.  Now this is all very well and good, but what happens if
>communication begins on that channel but for some reason breaks down half
>way through?  The ALT is dedicated already to the comms so cannot break
>out.  Also, is there an equivalent thing for timing out on a
>'no-transmit'?
Thanks everyone for your replies.

I misled you though:

I forgot to mention that my real concern is timing out if there are no
channels ready to receive -ie, try and transmit on a particular channel,
and if nothing becomes ready to receive after a set time, escape out of
that transmit.  
Normally Occam will wait until a process is ready to receive, before the
transmitting process can continue.  What I had meant to say before is
that there is a way to timeout on a receive, using the ALT construct.  Is
there a way to do the same thing for transmit? Obviously you can't use
the ALT, because its guard needs to be an inputting channel process.  
To get around the problem I have been trying to use the Extraordinary
link handling library - trying being the operative word.
Also, when I said 'if the receiver is expecting more than what is sent,
it will deadlock' I actually meant - what happens if, in the middle of a
communication, the link fails?
And in the same light - what happens if you try and transmit on a link
that was broken before you attempted to transmit - this is why I need the
timeout ability on the transmit side.  Essentially I need a way to
recover from a failure.
Am I just using the OutputOrFail.t incorrectly?  Has anyone ever used it?
 Does it work?

Thanks again
Gene Clendon
clendon@bnr.ca
my opinions are my own

