Intel® Threading Building Blocks

Task Execution Related Problem


I have some questions about the task execution.
Does all the tasks in the deque or the mailbox could be executed interchangeably?
I want to steal the task in other's mailbox and execute it right away under some special circumstances.
Is there anything I should aware of?

I find out that the task's execute() methods are only called in the wait_for_all().
Does that mean only the wait_for_all methods could make the task been executed?
I am trying to keep track of all the currently running tasks and record their affinity_ids.

For-loop performance, what's wrong?


I'm new to TBB and just started experimenting with it using tutorials. My first attempt is to test performance of a simple loop over a big array of floats. Once using TBB, and without. Comparing the time required for each tech, it was surprising. Check yourself and correct me if I'm doing somethign wrong:

#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
#include "tbb/tick_count.h"

using namespace tbb;

#define BIGARRSIZE 100000

float big_arr[BIGARRSIZE];

GPU + TBB: Scheduler Patch

Hi all,

The editor ate my last message. Lesson: don't try to attach files.

I'm working on combining CPU and GPU parallelism. I have a global data structure which stores special tasks which can run on either the GPU or CPU. I have a function called pbb::execute_data_task_cpu() that 1) returns true if if a task was found, and it was executed 2) returns false if the global GPU/CPU task data structure was empty. Notice that regular tbb::tasks still are there as always, the tasks I'm talking about are special and different.

tbb failed running on machine with only one CPU

Intel Doc said "There is no guarantee that potentially parallel tasks actually execute in parallel, because the scheduler adjusts actual parallelism to fit available worker threads. For example, when given a single worker thread, the scheduler obviously cannot create parallelism". I am a little confused about this.

Spin-Locks vs. Atomic Instructions

Hello all,

I have been implementing some algorithms from "The Art of Multiprocessor Programming" in TBB. I have found in this book, however, that it relies sometimes upon the Java volatile keyword. The best way to mimick this functionality in TBB, it seems, is to have a spin-lock wrapped around the variable that would have been volatile in Java.

Integrating TBB with other library

I am trying to integrate the perfmon library to TBB to give the task scheduler some extra hardware information.
However, I need to modify the Makefile to link an extra libpfm.a file provided by perfmon library.
I have scaned through the Makefiles in TBB package but still don't know how to do this.
Could you please help me with this problem

Any help would be grateful!!


Subscribe to Intel® Threading Building Blocks