|
Boost Users : |
From: Andrew Holden (aholden_at_[hidden])
Date: 2007-07-25 09:54:37
Toon Knapen wrote:
> I just received (again) some doc on the Intel Threading
> Building Blocks
> (TBB) (http://www.threadingbuildingblocks.org/).
>
> I was wondering how the boost.thread developers/supporters
> would compare TBB with boost.thread (btw: the book of James
> Reinders on TBB mentions boost.thread) ?
The two libraries are meant to solve different problems. Boost.thread
handles situations where the programmer wishes to explicitly manage
threads, often giving each thread a distinct task to perform. It would
be useful for situations like worker threads in a GUI program. It is
also useful I/O-bound threads, which would cause TBB to waste a
processor core.
TBB, on the other hand, is useful for situations in which you have a
parallelizable task to perform, and you would rather not worry about
threading details, like a parallel for loop.
Note that there is no reason you can't use both. You could, for
example, use boost.thread to launch one or more worker threads in your
program, which then use TBB to perform parallel tasks. Just remember
that each thread you create needs its own tbb::task_scheduler_init.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net