1 The Interlocked Family of Functions
LONG InterlockedExchangeAdd( PLONG plAddend, LONG lIncrement ); ....
2 volatile
3 Critical Sections
CRITICAL_SECTION
VOID InitializeCriticalSection(PCRITICAL_SECTION pcs);
BOOL InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION pcs, DWORD dwSpinCount);DWORD SetCriticalSectionSpinCount(PCRITICAL_SECTION pcs, DWORD dwSpinCount);
If you call this function while running on a single processor machine,
the dwSpinCount parameter is ignored and the count is always set to 0.
This is good because setting a spin count on a single-processor machine
is useless: the thread owning the resource can't relinquish it if another
thread is spinning.......