comp.lang.ada
 help / color / mirror / Atom feed
From: stefan-lucks@see-the.signature
Subject: Re: Tail recursion upon task destruction
Date: Wed, 18 Nov 2009 11:31:59 +0100
Date: 2009-11-18T11:31:59+01:00	[thread overview]
Message-ID: <Pine.LNX.4.64.0911181113290.8520@medsec1.medien.uni-weimar.de> (raw)
In-Reply-To: <1c0f7smxa240s.86mhal9qudx.dlg@40tude.net>

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 <http://www.adaic.org/standards/05rat/html/Rat-5-2.html#I1150>. 



-- 
------ Stefan Lucks   --  Bauhaus-University Weimar  --   Germany  ------
               Stefan dot Lucks at uni minus weimar dot de
------  I  love  the  taste  of  Cryptanalysis  in  the  morning!  ------




  reply	other threads:[~2009-11-18 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 10:17 Tail recursion upon task destruction Dmitry A. Kazakov
2009-11-17 21:38 ` Randy Brukardt
2009-11-18  8:41   ` Dmitry A. Kazakov
2009-11-18 10:31     ` stefan-lucks [this message]
2009-11-18 17:48       ` Dmitry A. Kazakov
2009-11-19  9:25       ` Egil Høvik
2009-11-18 11:02     ` Georg Bauhaus
2009-11-18 13:29       ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox