Boost logo

Boost Users :

From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2020-08-25 14:17:04


Hi,

I'm just about to start using the spsc queue in a project and whilst reading the example at:
https://www.boost.org/doc/libs/1_74_0/doc/html/lockfree/examples.html#lockfree.examples.waitfree_single_producer_single_consumer_queue

looking at the consumer function, there appears to be two while loops retrieving items from the queue inside the outer loop that checks whether the done variable is true.

Can somebody please explain why this is, or, is it a bug in the example? I would have thought one inner while loop would be enough.

Thanks,
Sean.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net