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: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada advocacy Date: Thu, 29 Aug 2013 11:28:34 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <19595886.4450.1332248078686.JavaMail.geo-discussion-forums@vbbfy7> <2012032020582259520-rblove@airmailnet> <12ee9bc5-3bdf-4ac0-b805-5f10b3859ff4@googlegroups.com> <6c58fae4-6c34-4d7a-ab71-e857e55897c0@x6g2000vbj.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: pcls7.std.com 1377790114 27107 192.74.137.71 (29 Aug 2013 15:28:34 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 29 Aug 2013 15:28:34 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:F8T6wdByi1BT/gutm9RwnzUEHY4= X-Original-Bytes: 3477 Xref: number.nntp.dca.giganews.com comp.lang.ada:183216 Date: 2013-08-29T11:28:34-04:00 List-Id: "Yannick Duchêne (Hibou57)" writes: > Why did you said “no big loss” about the rendez‑vous? That's too big a topic to discuss in the margin of this message. ;-) Just a few comments: Protected objects can do almost everything rendezvous can do, and I find protected objects to be more flexible. The main thing I miss when using protected objects is the 'terminate' alternative (as pointed out by J-P). The 'terminate' alt works only with accept statements, not with entry calls. Also, you can do multi-way waits with accept statements but not entry calls. These things are a loss, but not a "big" loss. These limitations of protected objects could be fixed, and then rendezvous would be truly superfluous. Suppose I have task A that wants to communicate with task B. When programming in Ada 83, I usually found myself adding another "passive" task in between A and B. Passive tasks look something like this: loop select accept E (...); do stuff; or ... or terminate; end select; end loop; It just feels wrong to me for that to be a task. It's not really doing anything; it's just sitting around waiting to be told what to do -- like a protected object. The "do stuff" above is likely some simple action like putting data in a queue or taking it out. A protected object seems better for that -- perhaps it's "lower level", but it's the RIGHT level. And with a protected object, you don't need a 'terminate' alternative in this case -- protected objects just go away like any passive object (say, an integer). With rendezvous, one of the tasks must know about the other (i.e. know its name), which increases coupling. One ought to be able to split out pieces of code into separate procedures -- that's an important tool for abstraction. Any language design that inhibits that is questionable, IMHO. As has been mentioned, accept statements must be lexically within the task body, which damages this capability. Rendezvous is a hugely complicated mechanism, which leads to bugs, not to mention inefficiencies. - Bob