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-Thread: 103376,c33f8f65997c21d0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.82.226 with SMTP id l2mr69388wiy.1.1348080503858; Wed, 19 Sep 2012 11:48:23 -0700 (PDT) Path: q11ni136811569wiw.1!nntp.google.com!feeder1.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Problem with task component Date: Wed, 19 Sep 2012 20:48:03 +0200 Organization: cbb software GmbH Message-ID: <1667b8e2qt7ei$.1gg1h3hrp9amz$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-09-19T20:48:03+02:00 List-Id: On Wed, 19 Sep 2012 19:22:07 +0100, Simon Wright wrote: > If a Limited_Controlled type has a component of a task type, is it wrong > to call an entry of the task from Initialize? Right, this is mandated by 7.6(12), because the alternative is much worse, in presence of class-wide access discriminant to the container, which most people want. The simple rule is that you should never ever have task components which you need to communicate to upon initialization and/or finalization. Always use pointers to tasks. But doing so, you should be extremely careful preventing dispatch in the task body during these actions. Which is the rationale for 7.6(12). P.S. I am afraid that all my rants about construction/destruction issues in Ada were in vain. P.P.S. The issue with task components falls into the category "class-wide constructor." Class initialization/finalization is the earliest/latest time when it is type-safe to communicate with a task that dispatches in its body. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de