Add a pair of condition variables to help avoid spinning.
Instead of tight loops with 1ms Sleep()s in them, add events for zero readers and zero writers that we can wait for instead. Unfortunately, since Events aren't interlocked with a critical section like condition variables are with mutexes in pthreads, we can't rely on this for race-free code, so for read locks, we still may spin under write pressure.
parent
b00aa9d4
No related branches found
No related tags found
Please register or sign in to comment