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: a07f3367d7,c33f8f65997c21d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.75.197 with SMTP id e5mr560774wiw.1.1348945549568; Sat, 29 Sep 2012 12:05:49 -0700 (PDT) Path: q11ni99746822wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Problem with task component Date: Mon, 24 Sep 2012 18:29:57 +0200 Organization: cbb software GmbH Message-ID: <1gq5enrpptnql.v7pdz1umht4a$.dlg@40tude.net> References: <1667b8e2qt7ei$.1gg1h3hrp9amz$.dlg@40tude.net> <187uk10m6z8xj.yr1cpbgrdur$.dlg@40tude.net> 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-24T18:29:57+02:00 List-Id: On Mon, 24 Sep 2012 08:44:32 -0700 (PDT), Adam Beneschan wrote: > (2) Off the top of my head, I don't see any *implementation* reason why a > selective accept couldn't have both a delay alternative and a terminate > alternative. Else-alternative is no less important than delay. We need something like select terminate; -- Terminate if requested otherwise continue else null; end select; > It seems like it wouldn't require the runtime library to do anything it > doesn't already know how to do. There is also a lesser issue with terminate. It does not allow a sequence of statements to execute before termination. The workaround requires quite clumsy constructs involving controlled types. -------- I thought about a predefined task entry T'Terminate to determine if termination requested. It would resolve most of the problems the terminate alternative has. We would simply write: task body T is begin loop select accept T'Terminate; exit; or ... whatever end select; end loop; end T; T'Terminate would never be dequeued, i.e. could be accepted as many times as necessary. If allowed to be called explicitly, it could also be used as an unobtrusive task abort request, with the advantage that it could be requested using a timed entry call: select T'Terminate; or delay 1.0; Put_Line ("Something is wrong with T"); abort T; -- Die already, dog! end select; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de