Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2417 Discussions

tbb/concurrent_bounded_queue - multiple consumer

rakeshusenet
Beginner
118 Views
I am using the tbb concurrent bounded queue , class, for a single producer - mutlple consumer version. Curious if the semantics of tbb concurrent bounded queue allow for multiple consumers ?
TBB version:tbb30_20110427oss
In other words - if there are many threads , that are waiting for:
Worker thread:
MyRequest req;
q->pop(req); //blocking call to receive the request by a worker thread.
Would multiple consumer consuming off the same queue, result in nasty race condition or the semantics are ok with the same ?
0 Kudos
1 Reply
RafSchietekat
Black Belt
118 Views
If you don't trust what the Reference has to say, perhaps this quote from the header file helps:

"Multiple threads may each push and pop concurrently."
Reply