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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7001494ace46eea7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-20 02:59:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.174.75.178!news-fra1.dfn.de!fu-berlin.de!uni-berlin.de!b88f5.pppool.DE!not-for-mail From: Dmitry A.Kazakov Newsgroups: comp.lang.ada Subject: Re: Overriding discriminants perplexes GNAT 3.14p Date: Sat, 21 Sep 2002 00:06:27 +0200 Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: b88f5.pppool.de (213.7.136.245) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1032515940 5604411 213.7.136.245 (16 [77047]) User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:29208 Date: 2002-09-21T00:06:27+02:00 List-Id: Adam Beneschan wrote: > Dmitry A.Kazakov wrote in message > news:... > >> 2. Circular requeue hangs at run-time under Linux: >> >> package Objects is >> protected Object1 is >> entry Point1; >> entry Point2; >> end Object1; >> protected Object2 is >> entry Point1; >> end Object2; >> end Objects; >> ------------ >> package body Objects is >> protected body Object1 is >> entry Point1 when True is >> begin >> requeue Object2.Point1; >> end Point1; >> entry Point2 when True is >> begin >> null; >> end Point2; >> end Object1; >> protected body Object2 is >> entry Point1 when True is >> begin >> requeue Object1.Point2; >> end Point1; >> end Object2; >> end Objects; >> ------------ >> with Ada.Text_IO; use Ada.Text_IO; >> with Objects; >> >> procedure Test is >> begin >> Objects.Object1.Point1; >> Put_Line ("That's OK"); >> end Test; > > I think GNAT's behavior is legitimate here. Protected entry calls and > external requeues start new "protected actions" on the target > protected object (9.5.3(8), 9.5.4(11)). Thus, when > Objects.Object1.Point1 is called, a new protected action is started on > Object1. When this requeues to Object2.Point1, a new protected action > is started on Object2; however, the protected action on Object1 does > not complete (AI95-00148). Really? 9.5.4(10) says explicitly (for an internal requeue) that the ongoing action continues., but following it 9.5.4(11) keeps silence about that. From which I would assume that the ongoing action is replaced by a new one. If not, then a task may simultaneously perform an unlimited number of protected actions! I see no sense in that, and moreover, it would make external requeues almost useless. -- Regards, Dmitry Kazakov www.dmitry-kazakov.de