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

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

nitinsayare
Beginner
379 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
379 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.

0 Kudos
Alexey-Kukanov
Employee
379 Views
The fix is provided in the most recent development update of 2008-08-25.
0 Kudos
Reply