comp.lang.ada
 help / color / mirror / Atom feed
From: ldb <ldb_nospam@hotmail.com>
Subject: Re: Problems with dynamic allocation in tasks
Date: Wed, 25 Jul 2007 10:04:48 -0700
Date: 2007-07-25T10:04:48-07:00	[thread overview]
Message-ID: <1185383088.872717.223020@l70g2000hse.googlegroups.com> (raw)
In-Reply-To: <wcczm1kfn4i.fsf@shell01.TheWorld.com>

On Jul 25, 12:45 pm, Robert A Duff <bobd...@shell01.TheWorld.com>
wrote:
> ldb <ldb_nos...@hotmail.com> 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).




  reply	other threads:[~2007-07-25 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-25 16:11 Problems with dynamic allocation in tasks ldb
2007-07-25 16:45 ` Robert A Duff
2007-07-25 17:04   ` ldb [this message]
2007-07-25 17:25     ` Robert A Duff
2007-07-25 18:35     ` Dmitry A. Kazakov
2007-07-26 20:56 ` Simon Wright
replies disabled

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