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.
2421 Discussions

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

Customer__Intel6
Beginner
139 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
139 Views
No, that's completely different containers.
Customer__Intel6
Beginner
139 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.
zweistein
Beginner
139 Views
Hi,
I need a dequeue, too. What existing container did you use before? maybe we can use it parallel to intel tbb.
lg
Alexey_K_Intel3
Employee
139 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".
RafSchietekat
Black Belt
139 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).
Reply