Subj : Re: speed-up critical regions To : comp.programming.threads From : amorox Date : Thu Jun 16 2005 03:28 am David Schwartz wrote: > wrote in message > news:1118873412.659131.122870@g14g2000cwa.googlegroups.com... > > > I thought about using 'local' pools for each thread. > > > Unfortunatelly this is not solving the problem. The locks are still > > needed. > > > An object could be visible over multiple threads. So, while Thread A > > may ask for a new object, Thread B may ask for destroying an object was > > created by Thread A. Both are acting on the internal structure of the > > same pool (owned by Thread A), so you need to lock the alloc function > > against the destroy function. > > Just return the object to thread B's allocator. You may need to balance > the allocators though, which is kind of a PITA. Sorry, but I don't understand your point of view. Would you explain more? Ragards, Ovidiu > > DS .