rigtorp / MPMCQueue

A bounded multi-producer multi-consumer concurrent queue written in C++11
MIT License
1.15k stars 159 forks source link

Can just set the turn to true or false to represent reading or writing is done #27

Closed haicoder closed 3 years ago

haicoder commented 3 years ago

According to the implementation.

Enqeue:

Dequeue:

Dose this work?

Thank you.

rigtorp commented 3 years ago

No! If there are more threads than there are slots in the queue it wouldn't work. So best to avoid that limitation.