Article View: comp.sys.transputer
Article #2022Re: How to send a variant protocol over a link?
From: 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
Technical Details
Message-ID:
<1105@its63b.ed.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!ukc!its63b!sfbtReferences:
<8803171831.AA04508@tcgould.TN.CORNELL.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!ukc!its63b!sfbt From: sfbt@its63b.ed.ac.uk (S Tett) Newsgroups: comp.sys.transputer Subject: Re: How to send a variant protocol over a link? Message-ID: <1105@its63b.ed.ac.uk> Date: 19 Mar 88 17:26:20 GMT References: <8803171831.AA04508@tcgould.TN.CORNELL.EDU> Reply-To: sfbt@phyvax.ed.ac.uk (Simon Tett) Organization: LFCS, University of Edinburgh Lines: 27