Article View: comp.sys.transputer
Article #1904Re: "Counted Array"
From: Knut Menzel
Date: Tue, 26 Jan 1993 13:46
Date: Tue, 26 Jan 1993 13:46
30 lines
1838 bytes
1838 bytes
|> Hi Netters
|> I am shifting my focus from Occam to C now. The following question made
|> me confusing, i.e. how to implemente the counted array of Occam in C
|> efficiently?
|> For example, we can replace
|>
|> Input ? Length :: Array -- In Occam, receiving the length and array together
|> with two C channel statements
|>
|> Len = ChanInInt(Input) /* In C, the Length must be known in advance
|> ChanIn(Input, Array, Length)
The normal way to implement the counted array of Occam in C efficiently
is the same as in Occam. Use two channel statements...
Len = ChanInInt(Input) /* Receiving the length of the next stream */
ChanIn(Input, Array, Len) /* Receiving the data of size Len */
That's all. Instead of the first statement it is possible to send a header
of constant length to the receiving node in order to present more information
of the sender (function number, ID of sender,...) than just an integer.
-- Knut
--------------------------------------------------------------------------
Knut Menzel University of Paderborn
email: knut@uni-paderborn.de Department of Computer Science FB17
...!uunet!unido!pbinfo!knut Warburger Str. 100
Tel: +49 5251 603325 D-4790 Paderborn
Telefax: +49 5251 603853
--------------------------------------------------------------------------
Technical Details
Message-ID:
<1k3fblINNnjp@news.uni-paderborn.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uni-paderborn.de!knutReferences:
<19JAN199314153354@vxcrna.cern.ch>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uni-paderborn.de!knut From: knut@uni-paderborn.de (Knut Menzel) Newsgroups: comp.sys.transputer Subject: Re: "Counted Array" Date: 26 Jan 1993 13:46:29 GMT Organization: University of Paderborn Lines: 31 Distribution: world Message-ID: <1k3fblINNnjp@news.uni-paderborn.de> References: <19JAN199314153354@vxcrna.cern.ch> Reply-To: knut@uni-paderborn.de NNTP-Posting-Host: ruhr.uni-paderborn.de