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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8bfa8c460ead1701 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!l70g2000hse.googlegroups.com!not-for-mail From: ldb Newsgroups: comp.lang.ada Subject: Re: Problems with dynamic allocation in tasks Date: Wed, 25 Jul 2007 10:04:48 -0700 Organization: http://groups.google.com Message-ID: <1185383088.872717.223020@l70g2000hse.googlegroups.com> References: <1185379864.592973.73220@b79g2000hse.googlegroups.com> NNTP-Posting-Host: 206.210.81.55 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185383089 25170 127.0.0.1 (25 Jul 2007 17:04:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 25 Jul 2007 17:04:49 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: l70g2000hse.googlegroups.com; posting-host=206.210.81.55; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1175 Date: 2007-07-25T10:04:48-07:00 List-Id: On Jul 25, 12:45 pm, Robert A Duff wrote: > ldb writes: > >...Ideally, i'd be able to > > create a task-local memory pool that doesn't require a mutex for these > > allocations.. not sure how feasible this is in Ada, though. > > It's quite feasible. Look up storage pools (section 13.11 in the RM). > > - Bob I'm at a loss for how this possible using storage pools. I've worked a good deal with storage pools but perhaps my vision of their functionality is too narrow. It was my belief that a storage pool can only be used globally for a particular type. These dynamic allocations are done with global types, ie, Access_Vector. Certainly a storage pool can be attached to Access_Vector and intercept, figure out which thread its in.. but then what? In a "simple" implementation, I'm still depending on System.Memory (which is malloc()) and it's still gonna hit these mutexes. I -could- make the storage-pool implement a full allocator so it's not dependant on malloc() for each allocation. This is alot of work and there are alot of types. If I go this route, I'd prefer to do a global replace (which goes back to my original question of how to do it like gmem does it).