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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3cfaa627fc3366de X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!n5g2000yqh.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Task origin track from a class Date: Wed, 13 Jul 2011 09:31:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3790e1e7-ab81-47a0-8d21-e9dda147d905@n5g2000yqh.googlegroups.com> References: <4o0rnqqqec1s$.19h46xsbjbku2.dlg@40tude.net> <024dd037-7c8f-460a-8ec4-0bf2456435ee@fq4g2000vbb.googlegroups.com> <13h82glc3htf0.1sjzw91gfndbf$.dlg@40tude.net> NNTP-Posting-Host: 24.230.151.194 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1310574708 7555 127.0.0.1 (13 Jul 2011 16:31:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 Jul 2011 16:31:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n5g2000yqh.googlegroups.com; posting-host=24.230.151.194; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21165 Date: 2011-07-13T09:31:47-07:00 List-Id: On Jul 13, 2:41=A0am, "Dmitry A. Kazakov" wrote: > On Tue, 12 Jul 2011 17:36:29 -0700 (PDT), Shark8 wrote: > > On Jul 12, 5:31=A0am, 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. You misunderstand me; I was asking that if it's generally impossible to destroy such a construct then would the use of such a construct be allowable (or desirable) in the cases where the destruction of such construct is itself generally undesirable/invalid. > The actual problems > are: > > 1. The procedure of destruction of the objects having task components. > Tasks are completed *before* Finalize is called. Shouldn't they be completed before Finalization of the object? And, if they are still running, shouldn't a finalize force termination?