Skip to content
  • Deucе's avatar
    51448015
    Add a pair of condition variables to help avoid spinning. · 51448015
    Deucе authored
    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.
    51448015
    Add a pair of condition variables to help avoid spinning.
    Deucе authored
    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.
Loading