Problem with thread priorities
In my C++ console application running under Windows XP, a thread with THREAD_PRIORITY_HIGHEST (Thread B) is preempting a thread with THREAD_PRIORITY_TIME_CRITICAL (Thread A).
Thread B is blocking on a WaitForSingleObject() call. Thread A will wake Thread B with a SetEvent() call. But since Thread A has higher priority, I would expect Thread A to complete running before Thread B will run. But thatís not the case. As soon as Thread A issues the SetEvent() call, Thread B starts running even though it has a lower priority than Thread A.
I disabled priority boost, thinking that might be the culprit, but I still see this happening. Does anyone know what else could be causing this?
Thanks for your help.