comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Class with task destructor
Date: Fri, 25 Nov 2011 13:40:27 +0000 (UTC)
Date: 2011-11-25T13:40:27+00:00	[thread overview]
Message-ID: <jao5sb$ri3$1@dont-email.me> (raw)
In-Reply-To: 25043081.79.1322185079284.JavaMail.geo-discussion-forums@yqmm19

On Thu, 24 Nov 2011 17:37:59 -0800, Rego, P. wrote:

>> Are you by any chance trying something like the RAII pattern in C++?
>> (which as far as I can see, stands for "automatic destruction is
>> orderly shutdown")
> Yes, something like this.
>  
>> If so, I think I'm with Dmitry, in that Controlled (or
>> Limited_Controlled) give you the tools to automate the process. 

> At this point it's not a big issue if the task knows the details. But
> the finalization timing concerns me a little. No problem if a task gets
> stuck when other is running, but I intend to run thousands of them in
> parallel, so I need to ensure this.

Well your user will simply free a controlled object; either by it going 
out of scope (if it's on the stack) or an explicit delete.

Since it's a controlled object, your "Finalize" is automatically called 
before the actual memory is released; it is up to you to write "Finalize" 
to shut the task down properly and only return when this is done. Then 
the actual deallocation will proceed safely. 
What is your concern about that sequence?

- Brian






      reply	other threads:[~2011-11-25 13:40 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  1:50 Class with task destructor Rego, P.
2011-11-23  2:44 ` Adam Beneschan
2011-11-23  5:04   ` Yannick Duchêne (Hibou57)
2011-11-23  6:14     ` Adam Beneschan
2011-11-24  0:15       ` Randy Brukardt
2011-11-24  2:48         ` Adam Beneschan
2011-11-29  3:36           ` Randy Brukardt
2011-11-29  9:31             ` Simon Wright
2011-11-29 15:37             ` Adam Beneschan
2011-11-23  8:35 ` Dmitry A. Kazakov
2011-11-23  9:05   ` Simon Wright
2011-11-23 10:41     ` Dmitry A. Kazakov
2011-11-30  1:11     ` Rego, P.
2011-11-30  2:21       ` Adam Beneschan
2011-11-30  8:41         ` Dmitry A. Kazakov
2011-12-01  0:35           ` Randy Brukardt
2011-12-01  6:28             ` J-P. Rosen
2011-12-01 10:55               ` Simon Wright
2011-12-01 21:48               ` Robert A Duff
2011-12-01 22:44                 ` Adam Beneschan
2011-12-02  0:57                 ` Randy Brukardt
2011-12-02  5:57                 ` J-P. Rosen
2011-12-02 15:07                   ` Robert A Duff
2011-12-02 18:41                   ` Jeffrey Carter
2011-12-01  9:25             ` Dmitry A. Kazakov
2011-12-01  1:58         ` Rego, P.
2011-11-30  8:35       ` Simon Wright
2011-11-30 15:36         ` Adam Beneschan
2011-11-30 16:32           ` Robert A Duff
2011-12-01  0:40             ` Randy Brukardt
2011-12-01  8:50               ` Yannick Duchêne (Hibou57)
2011-12-02  0:50                 ` Randy Brukardt
2011-12-02  5:30                   ` Jeffrey Carter
2011-12-02 16:20                     ` Adam Beneschan
2011-12-02 18:01                       ` Dmitry A. Kazakov
2011-12-02 18:50                       ` Jeffrey Carter
2011-12-02 19:03                         ` Adam Beneschan
2011-12-01 10:51           ` Simon Wright
2011-12-01 22:59             ` Simon Wright
2011-12-01  1:59         ` Rego, P.
2011-11-30  1:47     ` Rego, P.
     [not found]     ` <15090042.1880.1322617401962.JavaMail.geo-discussion-forums@yqkn8>
2011-11-30  8:43       ` Dmitry A. Kazakov
2011-12-01  1:53         ` Rego, P.
2011-12-01  9:28           ` Dmitry A. Kazakov
2011-11-25  2:44   ` Rego, P.
     [not found]   ` <28489797.1088.1322188495508.JavaMail.geo-discussion-forums@yqf20>
2011-11-25  9:19     ` Dmitry A. Kazakov
2011-11-29  3:40       ` Randy Brukardt
2011-11-23 10:26 ` Brian Drummond
2011-11-25  1:37   ` Rego, P.
2011-11-25 13:40     ` Brian Drummond [this message]
replies disabled

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