Intel® Threading Building Blocks

internal compiler error

Hello Everyone,

I am trying to build tbb program with parallel_for    



    [&](tbb::blocked_range<int> &r, size_t thdId) {

        for(int i = r.begin(), i_end = r.end(); i < i_end - 1; i++) {

            for (int j = 0; j < len ; j += 1) { 

                a[i][j] += a[i + 1][j];




I am building it using g++ on 64-bit linux machine with version 5.4. I am getting this error while building it 

parallel_for to test whether a property holds for at least one element of an array

In sequential programming, if I want to test whether a property holds for at least one element in an array, I can do:

for(auto x : container) {
  if (property(x)) return true;
return false;

Using a TBB parallel_for, I can iterate over all elements in a container and set a variable (initialized to false) to true if the property is satisfied. Yet this seems sub-optimal: if this variable becomes true, we still examine all remaining elements.

Getting output of nodes from flow graph, and specifically async_node

I've seen examples of sending input to a node of the flow graph from C++ code outside of the flow graph by using:


Could you provide examples of how to receive output from a node of the flow graph by C++ code outside of the flow graph? I'm especially interested in getting output of async_node. I tried 

output_type result;

while( node.try_get(result))

cout << "got result of " << result << endl;

Shutting down task arena while enqueuing tasks


I'm having problems shutting down a task arena while there are tasks running into it. The specific problem I have is that I hit a TBB assert while I'm trying to shutdown and an already-existing task is trying to enque other work into the same arena.

The program has the following requirements with respect to the task arena:

Subscribe to Intel® Threading Building Blocks