snykanen@cs.Helsinki.FI (Silja Nykanen) (01/02/91)
We would like to know if there is an exact definition for the out-operation of Linda. According to some articles "out(t) causes a tuple t to be added to tuple space; the executing process continues immediately." The problem is that if the process continues before the tuple is created, it is impossible to make correct programs using inp- and rdp-operations. There are not any guarantees that the inp-operation would succeed in the following example: out("T"); inp("T"); Silja Nykanen and Olli Raisa
tkammeye@sdcsvax@ucsd.edu (Thomas E. Kammeyer) (01/07/91)
In article <12439@hubcap.clemson.edu> snykanen@cs.Helsinki.FI (Silja Nykanen) writes: >We would like to know if there is an exact definition for >the out-operation of Linda. ... >There are not any guarantees that >the inp-operation would succeed in the following example: > >out("T"); >inp("T"); > My version of the "C-linda Reference Manual" says: (section 3.4, page 19) "A given tuple is evaluated and then added to tuple space with the out() operation. Once the tuple has been added, the executing process continues immediately." In human language: The all of the arguments to out() are evaluated by the process calling out() and then out() waits until it has finished adding the completed tuple to the tuple space before continuing (note the relative clause at the beginning of the second sentence of my quote. If your example used eval() in place of out, then of course the inp()'s success would depend completely 'pon whether process scheduling happened to run the process before the process which was forked to do the eval(). Hope this is helpful, and correct. If you lack a recent reference manual, and cannot acquire one, send e-mail and I'll be glad to help track down the relevant source. ---------------------------------------------------------------------------- >From the fevered brain of: Thomas E. Kammeyer Disclaimer: My opinions are mine alone... in particular they in no way are meant to be taken as policy or opinion of those I work for or of the University of California in general. If my facts turn out to be wrong, I will not be held responsible; I reserve the right to my fallibility and thus my humanity. Check my facts if you desire absolute certitude. ----------------------------------------------------------------------------
snykanen@cs.Helsinki.FI (Silja Nykanen) (01/07/91)
Thanks to Jerry Leichter (leichter@LRW.COM) for sending me an interesting reply to a Linda Question. At the end of the message he writes "Feel free to post a copy of this message to comp.parallel - I have no easy way of posting to Usenet newsgroups from here." .. so here is the copy of the message: You asked whether the code: out("tuple"); x = inp("tuple"); is guaranteed to set x to 1 (assuming, for the sake of simplicity, that tuple space is initially empty and that there are no other processes acting on it). The answer is, "probably". A better answer is: Forget about inp and rdp. They were a mistake that never belonged in the language; they happened to be trivial to add to a shared- memory implementation, so snuck in. But they cause a lot of problems in a distributed setting, confuse the semantics of the language, encourage the writing of buggy code, and ultimately add nothing to the expressiness of Linda. For arguments justifying these assertions, and a lot of discussion of Linda semantics, see my dissertation, "Shared Tuple Memories, Shared Memories, Buses and LAN's - Linda Implementations Across the Spectrum of Connectivity", available from the Yale Department of Computer Science as TR-714 (July 1989). (You'll probably get an answer from someone at Yale citing some recent paper in which a semantics which justifies the conclusion that x = 1 is cited. Don't take this to mean you should have been able to somehow guess that for yourself. Linda went along for years with an early 1960's-style "definition" with "obvious" semantics that no one ever bothered to write down - until, of course, what became "obvious" was that different readers (and different implementors) where finding different "obvious" interpretations.) Feel free to post a copy of this message to comp.parallel - I have no easy way of posting to Usenet newsgroups from here. -- Jerry