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 Received: by 10.180.107.167 with SMTP id hd7mr2929645wib.0.1348644453722; Wed, 26 Sep 2012 00:27:33 -0700 (PDT) Path: q11ni61637804wiw.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Problem with task component Date: Wed, 26 Sep 2012 09:27:58 +0200 Organization: cbb software GmbH Message-ID: <18te37e3kb1vq$.1bbagkhyd6aa1$.dlg@40tude.net> References: <1667b8e2qt7ei$.1gg1h3hrp9amz$.dlg@40tude.net> <187uk10m6z8xj.yr1cpbgrdur$.dlg@40tude.net> <1gq5enrpptnql.v7pdz1umht4a$.dlg@40tude.net> <19yadxsixu2y9$.1tfzkylgscckn$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.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="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-09-26T09:27:58+02:00 List-Id: On Tue, 25 Sep 2012 21:22:37 +0200, J-P. Rosen wrote: > Le 25/09/2012 20:35, Dmitry A. Kazakov a �crit : >> I need not to consider that. Termination of a task is normally determined >> solely by its master (terminating) and its internal state (open terminate >> alternative). I.e. strictly top-down. > > IIUC, the scheme you have in mind is a server task which, at some point, > either accepts calls from its master, or delays and do some processing, > but you want it to halt if the master is completed. You can write it > this way: > > task body Server is > begin > loop > select > accept ... do ... end; > or delay Time_Out; > exit when not Master_Task'Callable; > end select; > -- do something > end loop; > end Server; > > Note that when the master completes (for whatever reason, including > unhandled exception or abort), it is not terminated since it has to wait > for its dependent tasks, but it is no more callable. That's why you have > to check 'Callable and not 'Terminated. The weakness of this approach is that the client must know its master. It is almost never the case. And it is tight coupling from the software design POV. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de