Intel® Threading Building Blocks

using std::thread, std::mutex, etc. with tbb

The tbb documentation says little about compatibility with c++11. There are some tbb features emulating c++11 features, such as threads and mutexes (and even illegally implementing them directly in namespace std), but it's less clear how to operate tbb under c++11. Nowhere does the documentation say whether tbb::thread is identical to std::thread (via typedef or similar) in case of c++11 or not. In particular, I want to know:

Is std::thread::get_id() behaving as expected when used from within a tbb::task (i.e. providing an identifier unique to the running thread)?

mixing Intel MPI and TBB

I have been using a mixture of MPICH2 and TBB very successfully:
MPICH2 for machine-to-machine communication and TBB for inter-machine thread management.

Now, I am trying the very same code in the system which uses Intel MPI instead of MPICH2,
and I am observing a very odd behavior; some messages sent with MPI_Ssend is not being received
in the destination, and I am wondering whether it is because Intel MPI and TBB does not work well
together.

The following document

parallel_find()

TBB does not provide a parallel_find(), which would act similar to std::find(): find the first element in a range meeting a given condition/predicate. I think those who know the tbb library well should be able to implement this as follows: a range is split into a first and second half with the first half searched at higher priority (put on the stack last). If the first child task succeeds (finds a match), the second task is cancelled. This is done recursively, of course.

"Bug" in flow-graph together with termios.h

I wanted to report a "bug" which might appear when using the flow-graph.

In flow_graph.h(and probably all the other impl files) all the fake variadic-templates are being written using arguments B0-BN. The problem is that the old UNIX file termios.h defines B0 as 0. Now, when simply compiling you get a lot of compile errors because the B0 argument in the templates was replaced with 0.

I recognized this when using boost::asio together with the flow-graph.

Basic example:

Question on Concurrent_queue

Hi,

I am new to Intel TBB. I am using concurrent_queue in order to achieve fine-grained parallelism in my project. I got few doubts. This is how i am implementing.

thread_fun(arguments) {

while(concurrent_queue.try_pop(v))

          operation on v;  //each thread executes its own operation(seperate v for each thread)

}

main() {

          fill the concurrent_queue;

          create win32 threads and pass concurrent_queue as an argument; //using _beginthreadex

}

Páginas

Suscribirse a Intel® Threading Building Blocks