From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed.fsmpi.rwth-aachen.de!feeder.erje.net!us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: confusion about message passing between the tasks Date: Sun, 26 Oct 2014 16:27:34 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls7.std.com 1414355234 8541 192.74.137.71 (26 Oct 2014 20:27:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 26 Oct 2014 20:27:14 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:JnWWHbCcxMaaxSsgrXehnKx2t8k= Xref: news.eternal-september.org comp.lang.ada:22778 Date: 2014-10-26T16:27:34-04:00 List-Id: "J-P. Rosen" writes: > Le 26/10/2014 00:23, Robert A Duff a écrit : >> I prefer protected objects. Less coupling: two tasks can communicate >> with each other with neither one knowing the identity of the other -- >> they both just know about the protected object. >> >> If I were redesigning Ada from scratch, I'd leave out rendezvous. >> Everything you can do with rendezvous you can do with (something like) >> protected objects. > > ... and everything you can do with structured statements you can do with > if and goto. OK, then I'll make a stronger claim: Everything you can do with rendezvous you can do with (something like) protected objects, and do it just as cleanly, and sometimes even better. Now you're goto analogy doesn't work. ;-) I like case statements and while loops. > I strongly disagree with this position. Rendezvous is a nice model that > implements directly a client-server model. Of course, in this model, the > client has to know the server. So what? > > I view protected objects as a much lower level abstraction than > rendezvous; they are nice for simple synchronisation and simple needs, > but they don't scale up well for higher level abstactions. I agree rendezvous is higher level than PO's, but "higher level" is not always synonymous with "better". I find PO's to be at the *right* level. Ada 83 tasking has some baroque bells and whistles that, though they could reasonably be considered "high level", the just get in the way. In Ada 83, I found that in between every pair of communicating tasks, I wanted to add a passive "buffer" task or some such. I'm happy to use a PO there. >...Try to > Ravenscarize (!) existing software that uses rendezvous, and you'll see > what I mean (I did that recently). That's not a fair comparison, because Ravenscar is far more restricted than just "no rendezvous". For example, I find the queue-length-1 restriction pretty onerous. > And don't forget that with PO, you lose a very nice and poweful feature > of rendezvous: automatic termination. That's why I used the weasel words "(something like)". I would extend PO's to support everything that rendezvous can do, and eliminate rendezvous. It's tricky to figure out how terminate alternatives should work with PO's, but I think I've got it. Another thing is that you'd want multi-way call. I don't mean to say rendezvous is a Bad Thing. It's just not necessary when you have (something like) PO's, and it adds a lot of complexity to the language. I'm pretty sure that if Ada 83 had PO's, Ada 95 would NOT have added rendezvous! - Bob