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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4bd6ca8f7a1eb225 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.15.41 with SMTP id u9mr6816157pbc.3.1322805527220; Thu, 01 Dec 2011 21:58:47 -0800 (PST) Path: lh20ni56294pbb.0!nntp.google.com!news1.google.com!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Fri, 02 Dec 2011 06:57:35 +0100 Organization: A noiseless patient Spider Message-ID: References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <24938373.1788.1322615481874.JavaMail.geo-discussion-forums@yqjo5> Mime-Version: 1.0 Injection-Date: Fri, 2 Dec 2011 05:57:32 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="cJo7kSTQUrCFv2/D8KKtqw"; logging-data="12391"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zryybXxdA/ldK3dOBpTUY" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Cancel-Lock: sha1:1CEA55B0N6bsL7R/nVA9XiIUvgU= Xref: news1.google.com comp.lang.ada:19302 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2011-12-02T06:57:35+01:00 List-Id: Le 01/12/2011 22:48, Robert A Duff a �crit : > "J-P. Rosen" writes: > >> Put an entry (say "Termination_Wait") in the waited task, and never >> accept it. Call Termination_Wait from the waiting task. When the waiting >> task receives Tasking_Error, the waited task is terminated (well, >> completed, but that should be close enough). For the special case of the OP (freeing the task's space), you are right, but this trick is quite useful in the general case. Even in the OP case, you can add a busy loop once the task is completed; this one is likely to be executed at most once (on an uni-processor, there is less concern about busy loops on multi-processors). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00