Subj : Re: speed-up critical regions To : comp.programming.threads From : Phil Frisbie, Jr. Date : Wed Jun 15 2005 10:45 pm amorox@gmail.com wrote: > Hi, > > Thanks for your answer. > > I'll try to explain more about my problem. > > I need the critical region to protect an alloc function. > > I have something very similar with what Glibc is using to implement the > malloc function. You have arenas where your memory requests can be > hosted, but you need to lock the arena before using a part of it. Once > locked, you just need to make some cheap operations in the arena (since > the memory space was allocated before in chunks) and return the > demanded amount of memory. Sounds like you could use The Hoard Multiprocessor Memory Allocator. http://www.hoard.org/ Or, if you want to 'roll your own' implementation, I would suggest using thread local storage to allocate each thread a pool of memory so there will not be ANY locks needed! -- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com .