Intel® Threading Building Blocks

How to call Core component function/macro of IXP2xxx network processor?

I'm using IXP2350 Network processor. I found that there are some Core component macros as mentioned in "Intel Internet Exchange Architecture Software Building blocks" document. I wonder how to use them? Do I need to include them in source code of MEs as other macros?

Thank you very much for your consider and help!

Don't Forget - There's a TBB IRC Channel

Just wanted to let everyone know that there is an unofficial IRC channel for TBB at Just join #tbb. We've had some interesting discussions on the channel, however there's been a steady decline of users for whatever reason.

You can find more info here:


Is it ok to add iterators to blocked_range?

I had been using blocked_range a bit, but was getting tired of writing custom functor objects all the time, so I began trying to use boost/foreach and boost/mem_fn, but got compiler errors about lack of iterator, so looked into the header and found blocked_range doesn't have iterators. It has a const_iterator, but not an iterator. Also the const_iterator isn't actually const at all.

So I added to file:blocked_range.h around line:50

//! A range over which to iterate.

/** @ingroup algorithms */


class blocked_range {


efficiency question in TBB

When I am testing efficiency of the TBB programs. Carry out the same TBB programs 10,000 times.
The first several efficiency is always worse. what kinds of reason could cause this?

test method :
task_scheduler_init init;

for(int i = 0; i < testcount; i++){
tick_count t0 = tick_count::now();
parallel_for(blocked_range(0, size), ApplyFoo(source,dest,minus), auto_partitioner()); //for auto
tick_count t1 = tick_count::now();
sum = sum + (t1-t0).seconds();
fprintf(fp, " %d : %.12f\n",i, (t1-t0).seconds());
} // end for

Alternative Termination for parallel_do

Flush with success at my first parallel_for, I'm on to bigger and more complex. I now have a problem in which I have a stochastic process that is used to fill a data structure. The process can result in 0,1 or several additions to the data structure. I need to terminate when the data structure is full. The serial code is a simple do{StochasticProcess();}while (!dataStructure.isFull()); It takes 10's of thousands of calls to StochasticProcess to fill the dataStructure, and they are independent, so it's a great thing to parallelize.

Atomic floats, is this implementation safe?

I made an atomic float, and it's probably not blazingly fast (that's ok), but its faster than wrapping a lock around a float, and it works, but I'm not sure if this is because of my good luck, or if this is actually thread safe. I think it is... but you never know, so I came to ask the experts :)

struct AtomicFloat: public tbb::atomic


float compare_and_swap(float value, float compare)


size_t value_ = tbb::atomic::compare_and_swap((size_t&)value,(size_t&)compare);

return reinterpret_cast(value_);


TBB allocators in Win32++

I'm using a small GUI called Win32++.

In my applicationwhen usingSTL template containers I always supply a TBB allocator.Win32++on the other hand usesthe default allocator throughout. Win32++ is based on include files only so it would be fairly easy I think to make it use some other allocator by the specification of a parameter.

Problem compiling the sample program with the tbb distribution

I have just downloaded the src package and foolowed the getting strted tutorial but have the following error

g++ -O2 -DNDEBUG -o sub_string_finder sub_string_finder.cpp -ltbb
/usr/bin/ld: cannot find -ltbb
collect2: ld returned 1 exit status
make: *** [release] Error 1

I sourced the .sh file it created and am not sure what i am missing.


Iscriversi a Intel® Threading Building Blocks