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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ea9fbf0f08e5af8a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!h23g2000pra.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Delayed deallocation of non-terminated task in Gnat? Date: Tue, 30 Aug 2011 08:38:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <31ba531d-fa8e-40f3-97bc-c9112b329fe2@14g2000prv.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1314719156 13668 127.0.0.1 (30 Aug 2011 15:45:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Aug 2011 15:45:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h23g2000pra.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21723 Date: 2011-08-30T08:38:52-07:00 List-Id: On Aug 30, 6:22=A0am, Marc C wrote: > Saw this pop up in AdaCore's Developer Center notices: > > >[GNAT] Automatic deallocation of task upon termination > > >Monday August 29, 2011 > > >If Unchecked_Deallocation is called on a non-terminated task (which was = previously a no-op), > >the task is now marked to be freed automatically when it terminates. > > [http://www.adacore.com/2011/08/29/NF-65-H911-007-gnat/] > > This *looks* to me like one could dynamically allocate a task instance > and then immediately free it with an instantiation of > Unchecked_Deallocation, yet the task would continue to function > normally until it terminates. > > This seems rather a stretch to me, is there more to this than this > brief summary lets on? I think this is right---the task continues to function until it terminates. The only way to get a task to stop executing before it completes is to abort it (via an abort statement, or other semantics that cause an abort---see 9.8). An Unchecked_Deallocation instance finalizes the task object, but the semantics of finalization don't involve aborting. I'm having a bit of difficulty figuring out from the RM what the exact semantics of finalizing an unterminated task object are, but I'm pretty sure that aborting the task is not one of them. (Note that this applies only to tasks without discriminants. If the task has discriminants, freeing it is an error---13.11.2(11ff).) -- Adam -- Adam