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!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: confusion about message passing between the tasks Date: Sun, 26 Oct 2014 19:18:07 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 27 Oct 2014 02:18:02 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="206f88a41f45fc94d25d07d064d738e2"; logging-data="22853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++6oFq5fM2XTah9pWbngs0G7YfjiITBGs=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Cancel-Lock: sha1:qtq/jXdWOgnWH/nPkcHqj+ui0hg= Xref: news.eternal-september.org comp.lang.ada:22800 Date: 2014-10-26T19:18:07-07:00 List-Id: On 10/26/2014 05:46 PM, Robert A Duff wrote: > > In the PO case, we know that if Entry_1 was not acceptable, then Entry_2 > must be (at that time). In the "select/accept" case, there is a moment > in time when neither entry is acceptable (when T is going around that > loop, jumping back to the "select"). > > OTOH, perhaps you mean that "pragma Passive_Task" should change the > semantics of loop statements containing selects (and nothing else) such > that that window doesn't happen. That could work, I suppose, but it > means that the pragma is not just an optimization, but has a subtle > semantic effect. I'm not sure how to even write RM wording to capture > that. DEC Ada, and I think one other Ada-83 compiler, had pragma Passive (or something similar) which had the effect of optimizing the task so that it didn't have a thread of control. The task didn't have a time when it wasn't ready to accept one of the entries. It was effectively a PO. Back in the 1980s I heard presentations by compiler writers on automatically recognizing and optimizing passive tasks, and heard them say that they thought that the language designers expected that compilers would do that. As with variant records that only take up the space needed by the current instance, for which I've heard a similar claim, most compilers didn't do this. However, Ada 95 could have standardized the pragma and made it mandatory. This would have saved a new reserved word, and the result wouldn't have had any restrictions on what could go in an accept. I always thought it was a mistake to throw away all that work for a new construct. -- Jeff Carter "Why, the Mayflower was full of Fireflies, and a few horseflies, too. The Fireflies were on the upper deck, and the horseflies were on the Fireflies." Duck Soup 95