Intel® Threading Building Blocks

Generating thread safe random number generator for TBB


I have a function object for parallelizing a for_each() algorithm using Thread Building Blocks,The function object uses a random number generator RND whose operator method () generates a UNIFORM RANDOM number between 0 and 1

Problem: I need a random number number generator to

1) initialize only once in the function object

2) should be threadsafe and

3) can be provided same seed so that same results could be obtained.

Optimizing a TBB pipeline

Dear all,

I'm currently using a parallel pipeline with I/O bounded filters. Let me remind you my project, if you can bear with me.

A serial filter reads a string, a parallel filter transforms a string, and a serial filter writes back. In order to have better performance, or so I thought, the writer and transformers threads won't communicate directly. Instead, the transformer filter writes to a concurrent queue, and the writer pops from that. 

License for tbbmalloc.dll


I'm planning on using the tbbmalloc.dll precompiled binary distributed in the "open source" package for Thread Building Blocks.
However, I'm wondering about licensing because the application that will load this dll is not meant tot be open source.
As I'm only linking to it at runtime via my own written wrapper (in Delphi), I believe I'm covered by the runtime exception, but I'd prefer if someone could confirm this.

Thanks a lot for your answers.

pipeline pulus parallel for


in my app, I want to parallelize it with pipeline and parallel for. Each stage characters serial(There are dependence between different items of the same stage), and in each stage, I want to process the data in parallel, now, I do it with parallel_for. But it seems does not work. 

My questions are: TBB does not support task parallelism in producer-consumer patter. So, how should I do it?

stage1 // serial



stage2 // serial


stage3 // serial


Inspector XE 2013SP1 reports data race in _concurrent_unordered_impl


I just upgraded to the latest Intel Tools, including TBB to 4.2. Running the Inspector on one of my unit tests it reports some data races triggered by parallel calls from tbb::concurrent_unordered_map::find(). The data races are all related to the initialization of the buckets, see part of the call stack below.

Do I really got a problem here or is it a false positive ?


Subscribe to Intel® Threading Building Blocks