cameron314 / concurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Other
9.52k stars 1.66k forks source link

Occasionally program can be stuck inside try_dequeue of blockingconcurrentqueue.h #367

Open wudandan1221 opened 7 months ago

wudandan1221 commented 7 months ago

Why try_dequeue functions of blocking queue use while instead of if? when inner.try_dequeue(item) return false, it will never get out.

cameron314 commented 7 months ago

To take care of races. It should never get stuck in that loop.