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-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: Tail recursion upon task destruction Date: Wed, 18 Nov 2009 11:31:59 +0100 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <1c0f7smxa240s.86mhal9qudx.dlg@40tude.net> Reply-To: stefan-lucks@see-the.signature NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: tigger.scc.uni-weimar.de 1258554857 23052 141.54.178.228 (18 Nov 2009 14:34:17 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Wed, 18 Nov 2009 14:34:17 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: <1c0f7smxa240s.86mhal9qudx.dlg@40tude.net> Xref: g2news1.google.com comp.lang.ada:8144 Date: 2009-11-18T11:31:59+01:00 List-Id: On Wed, 18 Nov 2009, Dmitry A. Kazakov wrote: > Now consider a case when the last screw is removed from the device. This > 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" = regular termination, the options are "murder" = abort and "accident" = unhandled exception). See . -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------