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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8536537bd0d9744f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!a31g2000yqn.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Egil_H=F8vik?= Newsgroups: comp.lang.ada Subject: Re: Tail recursion upon task destruction Date: Thu, 19 Nov 2009 01:25:25 -0800 (PST) Organization: http://groups.google.com Message-ID: <223c826f-3f18-4ff5-832f-68d09734487a@a31g2000yqn.googlegroups.com> References: <1c0f7smxa240s.86mhal9qudx.dlg@40tude.net> NNTP-Posting-Host: 193.71.180.107 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1258622726 10252 127.0.0.1 (19 Nov 2009 09:25:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 19 Nov 2009 09:25:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a31g2000yqn.googlegroups.com; posting-host=193.71.180.107; posting-account=P68zsgoAAABKpXKMUuwuUZ_RfBk1kZfB User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8155 Date: 2009-11-19T01:25:25-08:00 List-Id: On Nov 18, 11:31=A0am, stefan-lu...@see-the.signature wrote: > On Wed, 18 Nov 2009, Dmitry A. Kazakov wrote: > > Now consider a case when the last screw is removed from the device. Thi= s > > is an operation eventually serviced by the device driver. I.e. within > > the device driver, you see, it was the last screw of the device and *if= * > > there is no other references to the device, it must fall apart. This is > > a case where you wanted the device to commit suicide. There is nobody > > else out there to do this. The device is dangling. This is not the only > > use case, just one possible case. > > OK, so you have a task (a device) which notices that it is no longer > useful. You would like such a task to do some cleanup and to commit > "suicide". Unfortunately, it can't do the cleanup after the "suicide", > because it is "dead" then. And it can't cleanup itself before being > "dead" because it needs its local memory until the very moment of its > "death". > > But couldn't you just use (or maybe abuse) the features from > Ada.Task_Termination to do perform the cleanup, after the task has died? > Even if it the "death" is not by suicide (apart from > "suicide" =3D regular termination, the options are "murder" =3D abort and > "accident" =3D unhandled exception). > See . > > -- > ------ Stefan Lucks =A0 -- =A0Bauhaus-University Weimar =A0-- =A0 Germany= =A0------ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Stefan dot Lucks at uni minus weimar dot d= e > ------ =A0I =A0love =A0the =A0taste =A0of =A0Cryptanalysis =A0in =A0the = =A0morning! =A0------ This would still be a bounded error. A task is not terminated until the task body has been finalized RM-9.3 (5), and since Task_Termination handlers are executed as part of the finalization of task bodies RM-C.7.3(14/2), you would violate RM-13.11.2(11) by deallocating the task in the handler. -- ~egilhh