Thread View: comp.sys.transputer
3 messages
3 total messages
Started by Stefan Friedli
Thu, 17 Mar 1988 13:08
How to send a variant protocol over a link?
Author: Stefan Friedli
Date: Thu, 17 Mar 1988 13:08
Date: Thu, 17 Mar 1988 13:08
20 lines
1240 bytes
1240 bytes
I hope someone can help with the following problem: For a program I currently develop, it would be a nice and elegant way to have a variant protocol on a physical link. As this is not supported by the configuring language (only CHAN OF ANY is allowed for links), I looked for (and found) a solution: declare the links as CHAN OF ANY, pass it as an actual parameter to some procedure that has as the corresponding formal parameter a channel of a variant protocol. Problem: This works fine (and does what it's supposed to do!!!)... on the compiler in d700C. The new compiler in d700D rejects this way of parameter passing and according to a note of INMOS (Writing occam programs to minimise future changes, June 24, 1987, paragraph 2: Protocols), this restriction will be kept in future releases. Anyone out there to help? Thanks. Stef.
Re: How to send a variant protocol over a link?
Author: S Tett
Date: Sat, 19 Mar 1988 17:26
Date: Sat, 19 Mar 1988 17:26
27 lines
1447 bytes
1447 bytes
In article <8803171831.AA04508@tcgould.TN.CORNELL.EDU> U06A@CBEBDA3T.BITNET (Stefan Friedli) writes:
>>
>I hope someone can help with the following problem:
>
>For a program I currently develop, it would be a nice and elegant
>way to have a variant protocol on a physical link. As this is
>not supported by the configuring language (only CHAN OF ANY is
>allowed for links), I looked for (and found) a solution: declare
>the links as CHAN OF ANY, pass it as an actual parameter to some
>procedure that has as the corresponding formal parameter a channel
>of a variant protocol.
The way to solve this little problem without recourse to hacking is
to declare a buffer.(I'll give an example for an output link)
PROC buffer(CHAN OF PROTOCOL ..... in,CHAN OF ANY out)
-- out is the output CHAN to the hard link
INT var1,var2,var3......:
WHILE TRUE
SEQ
in ? var1;var2;var3 -- assuming protocol is INT;INT;INT
out ! var1;var2;var3
:
Simon
Meteorology Dept/Physics Dept Concurrent "Super"-Computer User
Re: How to send a variant protocol over a link?
Author: Mark Hughes
Date: Tue, 29 Mar 1988 08:44
Date: Tue, 29 Mar 1988 08:44
18 lines
1362 bytes
1362 bytes
From article <8803171831.AA04508@tcgould.TN.CORNELL.EDU>, by U06A@CBEBDA3T.BITNET (Stefan Friedli): > > For a program I currently develop, it would be a nice and elegant > way to have a variant protocol on a physical link. As this is I can't try this and feel it sounds too simple, but... it should be possible to instert a dummy process between the physical link and your "variant protocal channel". This process would have two paramters, one a channel supporting your variant protocol and the other a CHAN OF ANY, "placed at" the physical link. The process's sole function is to relay information between the variant protocal channel and the link. It's a bodge, but simple enough not to be too unpleasant. I hope it works! -- ------------------- UUCP: mrh@camcon.uucp / ..uunet!mcvax!ukc!camcon!mrh | Mark Hughes | Telex: 265871 ref:MAG70076 |(Compware . CCL) | BT Gold: 72:MAG70076 ------------------- Teleph: Cambridge (UK) (0)223-358855
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads