Questions tagged [tbb]

Intel Threading Building Blocks (also known as TBB) is an open-source portable C++ template library for writing software programs that take advantage of multi-core processors.

From Wikipedia:

Intel Threading Building Blocks (also known as TBB) is a C++ template library developed by Intel Corporation for writing software programs that take advantage of multi-core processors. The library consists of data structures and algorithms that allow a programmer to avoid some complications arising from the use of native threading packages such as POSIX threads, Windows threads, or the portable Boost Threads in which individual threads of execution are created, synchronized, and terminated manually.

Instead the library abstracts access to the multiple processors by allowing the operations to be treated as "tasks", which are allocated to individual cores dynamically.

Threading Building Blocks Homepage

Intel® Threading Building Blocks Tutorial

770 questions
4
votes
3 answers

Results of tbb::parallel_reduce and std::accumulate differ

I am learning Intel's TBB library. When summing all values in a std::vector the result of tbb::parallel_reduce differs from std::accumulate in the case of more than 16.777.220 elements in the vector (errors experienced at 16.777.320 elements). Here…
VisorZ
  • 526
  • 1
  • 5
  • 15
4
votes
2 answers

TBB link with C++

I am trying to do some tests with TBB at HPCG benchmark. However I didn't compiled the program successfully so far. I am getting errors like these: src/ComputeSPMV_ref.o: In function `tbb::interface6::internal::start_for,…
user3562182
  • 365
  • 1
  • 5
  • 8
4
votes
2 answers

A question about TBB/C++ code

I am reading The thread building block book. I do not understand this piece of code: FibTask& a=*new(allocate_child()) FibTask(n-1,&x); FibTask& b=*new(allocate_child()) FibTask(n-2,&y); What do these directive mean? class object…
Jackie
  • 1,071
  • 2
  • 12
  • 17
4
votes
1 answer

intel tbb for IOS

Threading Building Blocks is a library that supports scalable parallel programming using standard C++ code. It does not require special languages or compilers. The ability to use Threading Building Blocks on virtually any processor or any…
user3682618
  • 87
  • 1
  • 8
4
votes
2 answers

How do I link against Intel TBB on Mac OS X with GCC?

I can't for the life of me figure out how to compile and link against the Intel TBB library on my Mac. I've run the commercial installer and the tbbvars.sh script but I can't figure this out. I have a feeling it is something really obvious and it's…
Nick Strupat
  • 4,928
  • 4
  • 44
  • 56
4
votes
1 answer

Tbb concurrent hash map iterator

I'm traversing an entire tbb concurrent hash map using an iterator and inspecting each (key,value) pair. for (MAP::pair = myHashTable.begin(); myHashTable.end(); pair++) How can I parallelize this iterator?
NewToAndroid
  • 581
  • 7
  • 25
4
votes
3 answers

using Intel TBB in C

I'm trying to use Intel TBB in C. All the documentation I get for TBB are targeted towards C++. Does TBB work with plain C? If yes how do I define an atomic integer. In the below code I tried using a template atomic counter (I know this will…
arunmoezhi
  • 3,082
  • 6
  • 35
  • 54
4
votes
2 answers

how to abort execution of a node and its children in tbb flowgraph

I'm currently testing the flow graph feature of tbb. In order to use it, I must be able to abort execution of some node in the graph, including all children which depend on it but leave other children which do not depend on it, executing. Throwing…
user678269
4
votes
2 answers

Is there an overhead on parallel_for (Inter TBB) similar to the overhead we see on std::function?

In this link std::function vs template there is a nice discussion about the overhead of std::function. Basically, to avoid the 10x overhead caused by heap allocation of the functor you pass to the std::function constructor, you must use std::ref or…
Vivian Miranda
  • 2,467
  • 1
  • 17
  • 27
4
votes
1 answer

Example of TBB concurrent_queue use

The Intel Thread Building Blocks library includes a concurrent_queue container. Unfortunately, digging around on the internet has yet to yield an example of a concurrent_queue being used in a parallel manner by the TBB library. Could someone provide…
Richard
  • 56,349
  • 34
  • 180
  • 251
4
votes
1 answer

Matlab limits TBB but not OpenMP

I'm only asking this to try to understand what I've spent 24 hours trying to fix. My system: Ubuntu 12.04.2, Matlab R2011a, both of them 64-bit, Intel Xeon processor based on Nehalem. The problem is simply, Matlab allows OpenMP based programs to…
omarzouk
  • 933
  • 10
  • 23
4
votes
1 answer

Thread Building Blocks concurrent_bounded_queue — how do I «close» it?

I am using concurrent_bounded_queue Intel TBB 4.1 Update 3 for communication between producer and consumer threads: concurrent_queue concurrent_bounded_queue The queue class has a method called abort which throws tbb::user_abort to all threads…
Mischa Arefiev
  • 5,227
  • 4
  • 26
  • 34
4
votes
1 answer

erasing from a concurrent associative container (concurrent_unordered_map)

I was looking for a concurrent associative container and I found concurrent_unordered_map from Thead Building Blocks which seems to be fit all of my needs. Even though I read the documentation, I haven't found a single example on how erasure…
TheBlackTiger
  • 313
  • 3
  • 9
4
votes
2 answers

Task continuations in Intel TBB

Is there anything similar to PPL's task continuations in TBB? I am aware of the low level TBB method of manuall allocating tbb::tasks and manually allocating continuation tasks too and managing ref counts manually for them: struct FibContinuation:…
Ed Rowlett-Barbu
  • 1,611
  • 10
  • 27
4
votes
2 answers

How to get return value from a function called which executes in another thread in TBB?

In the code: #include int GetSomething() { int something; // do something return something; } // ... tbb::tbb_thread(GetSomething, NULL); // ... Here GetSomething() was called in…
Nabijon
  • 821
  • 2
  • 13
  • 17