Subj : Re: speed-up critical regions To : comp.programming.threads From : David Schwartz Date : Wed Jun 15 2005 05:21 pm 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. DS .