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,4bd6ca8f7a1eb225 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.0.170 with SMTP id 10mr5304672pbf.2.1322779601111; Thu, 01 Dec 2011 14:46:41 -0800 (PST) Path: lh20ni54173pbb.0!nntp.google.com!news2.google.com!postnews.google.com!s7g2000yqa.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Thu, 1 Dec 2011 14:44:48 -0800 (PST) Organization: http://groups.google.com Message-ID: <8ed5921f-3e6e-4a7d-8651-7cd8793878f2@s7g2000yqa.googlegroups.com> References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <24938373.1788.1322615481874.JavaMail.geo-discussion-forums@yqjo5> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1322779600 2504 127.0.0.1 (1 Dec 2011 22:46:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 1 Dec 2011 22:46:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s7g2000yqa.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: news2.google.com comp.lang.ada:14780 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-12-01T14:44:48-08:00 List-Id: On Dec 1, 1:48=A0pm, Robert A Duff wrote: > "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 waitin= g > > task receives Tasking_Error, the waited task is terminated (well, > > completed, but that should be close enough). > > I don't think it's close enough. =A0It is impossible to actually > free things before the task is really terminated. =A0The task is > doing finalization between completion and termination, and that > could refer to discriminants. =A0And even if there's no finalization > present, the task is still using its stack, which had better not > be freed. And part of that finalization (the "first step" according to the RM) is to wait for dependent tasks. If the waited task has nested tasks, those tasks could still be running for an indefinitely long period after the waited task completes. And those tasks could refer to the parent task's local variables or discriminants. -- Adam