cameron314 / concurrentqueue

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

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

Open wudandan1221 opened 11 months ago

wudandan1221 commented 11 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 11 months ago

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