[comp.sys.transputer] Polling using a hard channel

chris@alsys.UUCP (Christopher Gray) (12/06/90)

I am developing an application in which it would be desirable to poll
a hard channel to determine whether or not a remote process is ready
to communicate over the hard channel.

Unfortunately this cannot be done in occam and there appears to be no
machine level instruction which allows this.

The application uses the routine OutputOrFail.t (from the occam
support library xlink.lib). With a "delay" of zero, this routine
always returns "aborted" for a hard channel even if there is a remote
process ready to communicate.  This is because communication over a
hard channel always results in descheduling of the communicating
process.  Unfortunately, setting timeout = (small value) also causes
problems due to the unknown length of time that the message takes to
read/write on a hard link.

Significantly, polling using soft channels produces no such problems
and works fine.  However, when using hard channels there appears to be
no way to achieve polling using software, at whichever level: occam;
occam support library; machine code.

greeny@wotan.top.cis.syr.edu (Jonathan Greenfield) (12/19/90)

In article <8685.9012070015@pyrltd.pyra.co.uk> chris@alsys.UUCP (Christopher Gray) writes:
>I am developing an application in which it would be desirable to poll
>a hard channel to determine whether or not a remote process is ready
>to communicate over the hard channel.
>
>Unfortunately this cannot be done in occam and there appears to be no
>machine level instruction which allows this.

I am confused about the problem here.  I have not had any trouble in
polling "hard" occam channels.  Any occam channel (hard or soft) can
be "checked" for the presence of a message using a PRI ALT statement.

i.e.,    PRI ALT
           hardchannel?somevalue
             SomeProcess()
           TRUE & SKIP
             SomeOtherProcess()

The TRUE & SKIP alternative provides an exit after an unsuccessful
communication attempt.  The PRI ALT forces the first alternative to be
chosen, if possible.  I have never detected any difference in the functioning
of such structures for hard and soft channels.

Of course, because occam only supports input polling, one must finagle in
order to check whether a process is ready to input--like having the input
process first send a request/ready output.  This may be more overhead than
you want, but it does work.

Is this what you were interested in?


greeny                                           greeny@top.cis.syr.edu

"What's the difference between an orange?"