A high waiter count on a free critical section may indicate a lock convoy

Raymond Chen

If you’re debugging a performance problem in your application, you may run across a critical section in a very strange state: A lot of threads are waiting for it, but nobody owns it!

0:000> !critsec 0x10009C70
CritSec at 0x10009C70
LockCount          37
RecursionCount     0
OwningThread       0

This state means that the previous owner of the critical section has just exited it and signalled a waiting thread to take it, but that thread hasn’t yet gotten a chance to run yet. This is normally a transient condition, but if you see it a lot, then you very likely the victim of a lock convoy.

Others have written about lock convoys, so I’m just going to refer you to them to get the details.


Discussion is closed.

Feedback usabilla icon