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.

Queue: Can't 'push' after 'clear' !!

nitinsayare
Beginner
147 Views
Hi All,
I am using tbb2.1. Surprisingly I am getting the segmentation fault when I am trying to push an element in the concurrent_queue after calling clear() on the concurrent_queue.

The following code is absolutely single-threaded, but it's crashing on last push (after clear).

Code:

concurrent_queue my_queue;
my_queue.push (10);
my_queue.push (20);
my_queue.push (30);

my_queue.clear();

my_queue.push(40); // What?? Can't I re-use the same object.
0 Kudos
2 Replies
Wooyoung_K_Intel
Employee
147 Views

Thanks for uncovering an issue. I can reproduce it. I'll try to push the fix into the developer's release as quickly as possible.

Alexey_K_Intel3
Employee
147 Views
The fix is provided in the most recent development update of 2008-08-25.
Reply