Subj : Re: speed-up critical regions To : comp.programming.threads From : Phil Frisbie, Jr. Date : Wed Jun 15 2005 05:33 pm amorox@gmail.com wrote: > Hi everybody, > > I'm trying to optimize the time needed to enter in a critical region > when it is consecutively executed in the same thread. > My idea was to use the RECURSIVE mutexes since the cost of a 'lock' on > an owned mutex is much less than on a non-owned mutex. You are sure that this is the case on all platforms you are targeting? My only other comment is that if you need a mutex in a speed critical region then you have an architecture problem you need to solve. Perhaps your data is too fine grained? If so then you need to break it up into larger blocks to eliminate most of the thread contention and thus reduce the cost of the mutex. -- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com .