Intel® Threading Building Blocks

spawn with enqueue


I want to exclude main thread. I have a longrunning work that should run independent of main thread. Also, the longrunning work has to work by splitting it multiple tasks. I have tried to create a root task and enqueue it. Afterwards, the root task spawned the child tasks.

For example,

longtask *root_task = new(task::allocate_root())longtask();


class longtask


         task* execute()


        set_ref_count(m_task_count + 1);

can concurrent_bounded_queue deadlock if producer and consumer have different thread priorities?


I am debugging an issue in my code where I have a concurrent_bounded_queue two producers threads and one consumer thread. The consumer has default thread priority and the producers have low thread priority.

Sometimes I get a deadlock with these stack traces:

Thread 66 (Thread 0x7ffedffff700 (LWP 9126)):

Making Parallel Sort Comparator Thread Safe


I'm using parallel_sort and regretfully my comparator needs to use a object that is not thread safe. I can make copies of this object for each thread and then the comparator would just need to use the right copy for the thread it is on, kind of like a thread_local but not global.

I'm looking for some tips on how to achieve this with TBB. I know task_scheduler_observer and enumerable_thread_specific are both options for implementing thread_locals but I'm not sure which is better in my case.

Thanks in advance!

Extending task class in tbb

I am trying to extend the task class and override the "spawn_and_wait_for_all" class function. Like this.


namespace tbb {

     class my_task: public task {


               void spawn_and_wait_for_all ( task& child ) { }



If the define the "spawn_and_wait_for_all" in the class itself (like above) I am able to call that function. But when I put the function definition in a separate cpp file I get an "undefined reference error". Like this


namespace tbb {

Allow for C++11 move semantics in TBB mutex and lock types

Please make tbb::queuing_mutex and tbb::queuing_rw_mutex non-movable in C++11 and later to meet C++11 requirements for STL mutexes (§30.4.1). Mutex implementations outside the STL are not required to meet the requirements for the STL, but this is probably what the developers would expect.

In addition, if possible, please also implement move constructors and move assignment operators for the respective scoped_lock inner classes. The std::lock_guard and std::unique_lock classes have this functionality. If this is not possible, please delete these methods.


Proposed patch 4.3 for simplifying compilation errors for tbb::atomic

Dear TBB Developers,

Please consider the attached patch for tbb43_20141009oss_src which simplifies the compilation errors for misusing tbb::atomic.

Basically, tbb users sometimes misuse tbb::atomic with unsupported types, for example.
And the compiler-error message about the misuse is not easy to understand since it exposes internal details about tbb.

Intel® Threading Building Blocks abonnieren