Subj : Re: Optimization to Jeffrey Richter's COptex (Windows)? To : comp.programming.threads From : Joseph Seigh Date : Wed Jan 26 2005 06:20 pm On Wed, 26 Jan 2005 22:12:14 GMT, Luke Elliott wrote: > > Also I noticed in there they use a lock, inc pair instead of lock, xadd > that the optex code will use (as a result of InterlockedIncrement), so > I'm going to try that and will report back if there's any noticeable > performance improvement. > inc sets condition flags. You need an algorithm that works with that. COptex doesn't since it need to know of the result == 1 or is > 1. Also xadd is only on 486(?) or later processors so your limited on which machines it can run on. CriticalSection goes way back. They probably haven't updated it. inc is slightlly faster than xadd but not enough that I use that a factor in design decisions. -- Joe Seigh .