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, T_FILL_THIS_FORM_SHORT 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!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.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 18:27:04 -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=us-ascii X-Trace: pcls7.std.com 1414362406 8541 192.74.137.71 (26 Oct 2014 22:26:46 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 26 Oct 2014 22:26:46 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:m+pJ56P9bCTOJhKX9YdZofTAVlE= Xref: news.eternal-september.org comp.lang.ada:22789 Date: 2014-10-26T18:27:04-04:00 List-Id: Jeffrey Carter writes: > On 10/26/2014 01:31 PM, Robert A Duff wrote: >> >> ...but the other way around isn't true. Here's Tucker's example that >> convinced me that some sort of "pragma Passive(Buffer_Task);" wasn't >> going to cut it. Write a PO a that is in one of two states, >> "accepting calls to Entry_1" and "accepting calls to Entry_2", >> never in both states at the same time, and never in neither state >> (as observed by callers). Pretty easy. With rendezvous, not so >> much. > > That seems pretty straightforward, whether with a PO or a passive task. Is there > some complication I'm missing? Maybe. Here's my PO code: type State_Enum is (Accepting_Entry_1, Accepting_Entry_2); protected P is entry Entry_1; entry Entry_2; private State: State_Enum := Accepting_Entry_1; end P; protected body P is entry body Entry_1 when State = Accepting_Entry_1 do ... if ... State := Accepting_Entry_2; end Entry_1; entry body Entry_2 when State = Accepting_Entry_2 do ... if ... State := Accepting_Entry_1; end Entry_2; end P; Can you show equivalent code using "accept"? - Bob