Intel® Threading Building Blocks

Static linking tbb


I'm writing a library where I'm linking to the open source version of tbb built as a static lib. This works fine but when I static link my library into a program it asks for the tbb library and I want my library to be self contained so people can use it without needing to link against tbb themselves. I've had a similar thing with boost where you can use a preprocessor definition to make your library self contained. I'm wondering how I can achieve this with tbb? 

Thanks a lot!

The method on_scheduler_exit() is not executed


I'm trying to use tbb::task_secheduler_observer to gather some statistics, collected by worker threads, when performing various tasks (parallel_do, mostly, but also other ones).
Unfortunately - the method on_scheduler_exit() is never called; on_scheduler_entry() is called normally, at the beginning, but not the former one. What am I doing wrong?
I've read that the process does NOT wait for all threads to clear up, but ading a ten-seconds-long sleep() in the main function changed nothing.

Oh, and should


TBB 4.3 Update 6 does not seem to integrate with Visual Studio 2013

I just installed the TBB 4.3 Update 6 for Windows and selected integration with Visual Studio 2013 during the installation. Now, in VS 2013 the TBBIncludeDir and TBBLibDir macros are undefined for all configurations in my C++ project property pages.I then re-ran the TBB 4.3 Update 6 installer and selected Modify and it showed the Visual Studio 2013 integration as not being installed.

Graph with multiple roots, multiple leaves


How do we implement an acyclic dependency graph which has multiple roots and/or multiple leaves?

EG if we take the graph in  without link X0,1-X0,2 we get a tree with two roots.

If we remove link X2,0-X2,1 we get a tree with two leaves. 

What does the code for these two graphs look like?



Compilation error while using tbb library

Hello ,
Warm greetings!

I am stuck at following compilation issue :

In file included from /usr/include/tbb/concurrent_hash_map.h:32:0,

                 from ../../../src/linkedlists/lockfree-list/BTO.h:10,
                 from ../../../src/linkedlists/lockfree-list/BTO.cpp:9,
                 from ../../../src/linkedlists/lockfree-list/intset.c:13:
/usr/include/tbb/tbb_stddef.h:121:56: fatal error: cstddef: No such file or directory
 #include <cstddef>      /* Need size_t and ptrdiff_t */

Initializing TLS for all threads in the scheduler

Hello, I'm a newbie experimenting with TBB for the first time. I want to set up an array in TLS for each thread in the TBB task scheduler so that I can later execute parallel_for across an array of objects that write events to the pre-allocated TLS. I've copied the approach to setting up the TLS from a demo application released by Intel some time ago (Intel Smoke demo), but I must be missing something because it works fine in their demo but not for me. 

Creating new partitioners


It's been a while since I've been there...

I have the following question: does it make sense to create my own partitioner for the tbb::parallel_for? It does not seem as something encouraged...

My problem is as follows: I'm migrating my TBB-based code onto the MIC architecture.
There is a parallel_for loop and it would make sense to force some of the iterations to be executed on the same cores.
Simplifying the actual code, slightly, let us assume, we have an array:

<code>int L[N];</code>

core dump on Assertion failure


I saw a core dump due to such assertion failure. I start having this failure after integrate some third party libraries into my system. I suspect that third-party library is using some native thread. But still it does not make sense to crash tbb.

I'm using Tbb on fedora20 x86-64.

Assertion block->checkFreePrecond(object) failed on line 2396 of file ../../src/tbbmalloc/frontend.cpp
Detailed description: Possible double free or heap corruption.

My question is: what does this failure mean?


Intel® Threading Building Blocks abonnieren