comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Question: What's the difference between pools of pools and Ada 2012's new subpools?
Date: Mon, 18 Feb 2013 17:24:34 -0600
Date: 2013-02-18T17:24:34-06:00	[thread overview]
Message-ID: <kfud7m$so1$1@munin.nbi.dk> (raw)
In-Reply-To: lyd2vzqi0w.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyd2vzqi0w.fsf@pushface.org...
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>
>> As Randy said the problem with pools when used for management the life
>> cycle of objects is finalization of controlled objects. If subpools
>> alleviate this problem is to be seen.
>
> What Randy said was that the _hand-written_ subpool implementations the
> ARG had seen had problems with finalizable objects. Of coaurse, in the
> end all implementations are hand-written by somebody.

Right (I think). When you create your own subpool-like mechanism, you can't 
force finalization of objects (unless you keep a list of objects in the 
subpool and free them individually, which would defeat the purpose). So most 
people's simply say that they cannot be used with controlled objects (or 
tasks or protected objects). Which is limiting.

The subpool mechanism in Ada 2012 is designed to ensure that objects are 
finalized no later than when the subpool is discarded (via 
Unchecked_Deallocate_Subpool). In that sense, it works just like 
Unchecked_Deallocation (except all at once, rather than one at a time). Of 
course, I can't know whether GNAT actually implements this correctly!

                                   Randy.





      reply	other threads:[~2013-02-18 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14  0:12 Question: What's the difference between pools of pools and Ada 2012's new subpools? Shark8
2013-02-14  0:56 ` Randy Brukardt
2013-02-14  2:34   ` Shark8
2013-02-17  1:06   ` Shark8
2013-02-17  9:06     ` Dmitry A. Kazakov
2013-02-17 11:47       ` Simon Wright
2013-02-18 23:24         ` Randy Brukardt [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