Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

concurrent_dequeue with {push,pop}_{front,back}

Customer__Intel6
Beginner
375 Views
Hi,
I am a new TBB user. Is it possible to extend the concurrent_queue to a concurrent_deque having push and pop operations from both front and back?

--Kannan.
0 Kudos
5 Replies
Dmitry_Vyukov
Valued Contributor I
375 Views
No, that's completely different containers.
0 Kudos
Customer__Intel6
Beginner
375 Views
Thanks for the reply. I am looking to migrate an existing library using pthreads which has a concurrent_deque to use TBB. Is there any plans to implement the concurrent_deque container in TBB? If not, can you tell me if there is any existing TBB container that could be adapted to mimic the functionality?
--Kannan.
0 Kudos
zweistein
Beginner
375 Views
Hi,
I need a dequeue, too. What existing container did you use before? maybe we can use it parallel to intel tbb.
lg
0 Kudos
Alexey-Kukanov
Employee
375 Views
For now, there is no concurrent container in TBB that would allow push() and pop() from two "ends", and no near-term plans to add such. I can only suggest the obvious "use a deque protected with a lock".
0 Kudos
RafSchietekat
Valued Contributor III
375 Views
It would be interesting to know whether the container being referred to currently provides better performance than a locked deque, or just locking sugar (wrapping each call with a call to the lock).
0 Kudos
Reply