Intel® Threading Building Blocks

Multiple tasks running concurrently in a single OS thread?


I wrote the following code the process a series of files in parallel:

std::vector<std::string> filenames;
// -> fill filenames
tbb::parallel_for_each(filenames.begin(), filenames.end(),
 [&](const std::string& filename)
log << "Start processing " << filename << " @Thread" << GetCurrentThreadId();
// -> process file
log << "End processing " << filename << " @Thread" << GetCurrentThreadId();

Sometimes after running the program I got the log output like following:



Could you explain me, can I use Intel TBB under QNX Neutrino? I can not find any advice or examples on how I could do this. Is it possible? Is it enough to just recompile the source files of Intel TBB in QNX or I should do anything else?

Thank you.

TBB and visual studio 2015


In tbb's latest version for windows there is just a library for ia32. I have windows 10 pro 64 bits and I have Visual Studio 2015 Community installed. I can compile an example using, for example, Debug x86 configuration but when I run it I get error 0xC000007B which is related to running 32 bit application on 64 bit systems.

The open source distribution has a visual studio 2012 solution to build the tbb library, I opened the solution on vs 2015 and it was updated with no problems.

Compile errors on Clang-C2

I am unable to #include <tbb/tbb.h> when compiling with Clang-C2 (Clang with microsoft code-gen) on windows.  I get a multiple errors.  I suspect these errors are most likely due to incorrect platform recognition.  I do not however, get the same errors when compiling with llvm-clang on windows, or any other compiler on windows or linux.

As clang-C2 is far better supported and feature complete it is my only option for clang usage on windows.

why do I have to define an array of mutexes?


In the sample programs for TBB there is an example for the use of concurrent_priority_queue, a program to find the shortest part in a tree,  the program used is shortpath.cpp In the programthere is an array defined as spin_mutex *locks, later in the function void InitializeGraph() the array is created as locks = new spin_mutex[N] where N is the number of vertices I want on the tree. If I want 20000 vertices I have to define 20000 mutexes

Subscribe to Intel® Threading Building Blocks