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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a6337228af80b02 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.75.8 with SMTP id y8mr2518930wiv.1.1361144919795; Sun, 17 Feb 2013 15:48:39 -0800 (PST) MIME-Version: 1.0 Path: g1ni17294wig.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newspeer1.nac.net!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!backlog2.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.meeh.mikalv.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Question: What's the difference between pools of pools and Ada 2012's new subpools? Date: Wed, 13 Feb 2013 18:56:42 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <8fe47d10-1889-43e7-be85-510ece95c1a6@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1360803405 4662 69.95.181.76 (14 Feb 2013 00:56:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 14 Feb 2013 00:56:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 3124 Date: 2013-02-13T18:56:42-06:00 List-Id: "Shark8" wrote in message news:8fe47d10-1889-43e7-be85-510ece95c1a6@googlegroups.com... >I recently asked this question on Stackoverflow ( >http://stackoverflow.com/questions/14840702/what-are-the-differerences-between-the-new-ada-sub-pool-features-and-pools-of-po ) >. > > I haven't used pools at all, yet; so it's quite likely I'm missing > something. > > ------- > -- Pool of Pools > ---------------------------------- > -- Minnesota: Land of 10,000 Lakes > type Minnesota(Size: Storage_Count) is new Root_Storage_Pool with private; > type Lake(Size: Storage_Count) is new Root_Storage_Pool with private > with Storage_Pool => Minnasota; Aspect Storage_Pool only applies to access types (13.11(15) and others), and type Lake is not an access type, so this is illegal (and makes no sense as well). You could implement one pool by putting other pools within its implementation (say Minnesota here including a an array of 10000 Lakes :-). But you'd then have to have a way to select which item belongs to each, ahem, subpool. And you'd be reinventing the wheel. There is also the issue of finalization. The subpool mechanism ensures that objects don't outlive their subpool (pointers to the objects might outlive the subpool, but not the object themselves), even when the subpool is explicitly destroyed early (just as Unchecked_Deallocation does). There's no good way to do that without language support (every hand-written subpool implementation that we talked about insisted that no controlled, protected, or task objects be allocated from it, which is obviously limiting). Let me assure you, getting this right was hard and contentious. It was nearly dropped a couple of times. Doing it yourself wouldn't be contentious (I hope!), but it would still be hard. Since the ARG has already done the dirty work, it's best to use it. Randy. Randy. Randy.