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,3cfaa627fc3366de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news-transit.tcx.org.uk!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Task origin track from a class Date: Wed, 13 Jul 2011 09:41:11 +0200 Organization: cbb software GmbH Message-ID: <13h82glc3htf0.1sjzw91gfndbf$.dlg@40tude.net> References: <4o0rnqqqec1s$.19h46xsbjbku2.dlg@40tude.net> <024dd037-7c8f-460a-8ec4-0bf2456435ee@fq4g2000vbb.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:20189 Date: 2011-07-13T09:41:11+02:00 List-Id: On Tue, 12 Jul 2011 17:36:29 -0700 (PDT), Shark8 wrote: > On Jul 12, 5:31�am, Simon Wright wrote: >> Simon Wright writes: >>> "Dmitry A. Kazakov" writes: >> >>>> So the unfortunate rule of the thumb is: never use task components, >>>> but access to task instead. From Finalize you would call Stop entry or >>>> an equivalent and then free the task object using >>>> Unchecked_Deallocation. >> >>> With GNAT, best not to free the task object until 'Terminated is True >>> (GNAT's I have used would silently fail to actually free the TCB! >>> resulting in an insidious memory leak). >> >> Oops, I forgot to add that I'd aborted the task first (as Dmitry said, >> it's not always possible to arrange a clean shutdown). > > Hm, would it be a usable idea for say the memory manager for an OS, > such that the requests to the manager from programs (and perhaps even > compilers) are delegated to the task; after all you don't want to shut > the memory-manager down (terminate the task) at any point in normal > operation. The issue has nothing to do with memory management. The actual problems are: 1. The procedure of destruction of the objects having task components. Tasks are completed *before* Finalize is called. Ada's approach to construction/destruction is very much broken. This is just one example of this. 2. The usage of the terminate alternative which cannot be mixed with for example the delay alternative. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de