Subj : Re: Hazard Pointers w/o memory barrier. To : comp.programming.threads From : Joe Seigh Date : Fri Apr 22 2005 07:48 am On Thu, 21 Apr 2005 11:24:35 -0700, Chris Thomasson <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote: >> You could probably also detect quiescent states by counting the >> context-switches per-thread using the performance api's... > > Arggfhgh! > > You need to do a device driver in order to tap into the "context-swap" hook > like Russinovich uses in PMon. > > http://www.sysinternals.com/ntw2k/freeware/pmon.shtml > > > You can scan processors for quiescent states instead of threads. It will work just as good. Using NtQuerySystemInformation() to get SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION or SYSTEM_INTERRUPT_INFORMATION for system times or interrupts on a per processor basis. It may be obsoleted though. The replacement for the system times is GetSystemTimes() which is aggregated and useless. I have to find where the server 2003 stuff moved to and see what functions are in there. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .