Subj : Re: Adding thread support for C... To : comp.programming.threads From : Chris Friesen Date : Tue Aug 02 2005 05:52 pm Marcin 'Qrczak' Kowalczyk wrote: > Charles Bryant writes: > > >>However, it would be wrong to assume that, for example, an atomic >>increment operation must be faster than a lock/increment/unlock >>sequence, when it might be slower. > > > Well, on a sensible implementation it will not be slower because it > can be implemented by this. Really? How would you make the lock/modify/unlock cycle faster than a single atomic increment? In the optimal uncontended case each of the lock/unlock will be an atomic operation, so you end up with one extra atomic as well as whatever modification that you were trying to do. Chris .