Intel® Threading Building Blocks

check if task is running

ive just converted my 3d engine from boost::threads to tbb and the task
system... which have greatly improved hte performacne of my
application... however i have one issue where i do not want the "main
windows message handling" thread to sleep...

currently my main loop looks something like this (very simplified)

TBB Source Code: Tasks Queues and Stealing


I'm looking at the TBB source in detail, in particular the scheduler.

What I would like to be able to do is write my own task stealing algorithm, in particular I want to be able to steal tasks from all CPUs at once (that have certain properties) and actually take them away from TBB altogether (migrate to another system).

Any pointers on where in the code I should be looking to interface? Right now I'm tracing through task.cpp, but I don't understand what is meant by "Gate" and "Arena". What are the actual task lists processed by CPUs?



TBB Exception Safety

Hey, I have an interesting problem with trying to make tbb exception safe. My code sets up an execution tree similar to 'Two Mouths' example in the TBB book. Here is the psuedocode:

tbb::task_group_context context(tbb::task_group_context::isolated);
tbb::task*root = new (tbb::task::allocate_root(context))tbb::empty_task;

Allocate all tasks as child of the root

root->set_ref_count(number of children + 1);


Leaking memory with scalable_malloc/free when closing threads

We've had an issue leaking memory when using scalable_malloc/free on Windows. The fix was to manually call mallocThreadShutdownNotification when the thread was exiting. I never saw any documentation nor was this in Reinders' book. I ended up reading the code in MemoryAllocator.cpp and saw that this was being registered in the pthreads implementation but not the winthreads implementation. To use it I had to include src bbmallocTypeDefinitions.h out of the source code and not the include directories.

Introducing a grain parameter for parallel_while?

Hi guys!

I find tbb::parallel_while very useful for my applications. However some experiments showed poor scalability due to a small iteration task weight as comapared with parallel_while and task stealing overheads. The scalability was improved after I enlarged the grain by grouping several iteration items into one item.

TBB example code projects need to be updated

This may or may not be an Intel problem.

In the newest version of the Intel Compiler Suite Professional Edition for Windows

TBB 2.0 is shipped. However the macros inside of the project file TBB examples are all referencing TBB11_INSTALL_DIR not TBB20_INSTALL_DIR . This probably should be changed to TBB_INSTALL_DIR and in the environment variables set


Or whatever the most recent installed copy is. The user can reset this to retrograde the version.

Jim Dempsey

Subscribe to Intel® Threading Building Blocks