Subj : Re: Challenge: Multithreading & Synchronization To : comp.programming.threads From : David Schwartz Date : Fri May 20 2005 06:01 pm "Uenal Mutlu" <520001085531-0001@t-online.de> wrote in message news:d6lskp$r71$03$1@news.t-online.com... >> See also this DOC of Micro$oft: >> http://www.microsoft.com/whdc/driver/kernel/locks.mspx >> (http://download.microsoft.com/download/e/b/a/eba1050f-a31d-436b-9281-92cdfeae4b45/Locks.doc) > > Citation from the above DOC: > > "InterlockedXxx Routines > The InterlockedXxx routines perform common arithmetic and logical > operations atomically, > ensuring correct results on SMP systems. Whenever possible, drivers should > use these routines. > Most of them are native processor instructions and therefore do not > require a lock. > The InterlockedXxx routines can be used with pageable data. They are > usually > implemented inline by the compiler and can be called at any IRQL." Then you've reinvented a less-efficient version of the spinlock. Congratulations. (Hint: What is the InterlockedXxx routine to check the value of a something without unsharing it?) DS .