Intel® Threading Building Blocks

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.

A TBB example does not compile in VS 2013

Hello All,

I was able to build and run shortpath example using the nmake and the Makefile to build the example. In the command line window (in Spanish is: Simbolo del sistema, I think Prompt window in English) I ran tbbvars.bat and I fixed PATH and INCLUDE environment variables:

set PATH=C:\Program Files (x86)\Microsoft Visual C++ Compiler Nov 2013 CTP\bin;%PATH%

set INCLUDE=C:\Program Files (x86)\Microsoft Visual C++ Compiler Nov 2013 CTP\include;%INCLUDE%

Then I executed nmake and the executable was built and I ran it.

Intel® Threading Building Blocks abonnieren