I put together a short video walkthru creating a skeleton Visual Studio 2008 project with Intel’s Threading Building Blocks that introduces the basics of using Threading Building Blocks and compares performance of serial and parallel sort.
The answer to my question about Thread Building Blocks’ usefulness for non-algorithmic parallelization (i.e., in a word, threading ;) was tucked away in a Change Log (it seems that TBB could use a little work on its documentation revision, and the book predates the change).
ISO C++ thread class – A thin portable wrapper around OS threads. It’s a close approximation of the ISO C++ 200x class thread (Section 30.2 of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf). Now TBB lets you choose which is best, task-based versus thread-based, for your situation. Threads are typically better than tasks when the “work” is really more waiting than computation, such as for:
- GUI, I/O or network interface threads.
- Threads that need to wait on external events.
- Programs that previously needed to use both native threads and Intel® TBB tasks.
Well, at least now I have a more immediately useful pet-project to work on: writing a generic encapsulation of a resource-sharing and resource-specific worker pool. Resource-sharing: a shared pool of resources which the workers variously use – which they use is indefinite i.e. a resource; Resource-specific: a pool that will handle specific actions for specific resources, i.e. this specific resource.
Resource-sharing: Write this data to any database handle in the pool; Resource-specific: Someone write this data to connection #42.
My favorite part of the overview video at the top is the “Parallel Composer” part, specifically where he shows us some menu items.
Uhm; wait a second… Parallel “Composer”… Appears to be The Intel Parallel Compiler Professional, which also includes the Thread Building Blocks and IPP libraries… And, uh, also come with what is badged here as “Parallel Inspector”.
Infact, so far as I can tell, the only difference between buying “Parallel Studio” and Intel Parallel Compiler is that the Parallel Composer version comes with Parallel Amplifier (which sounds like it might be v-tune).
Their naming bothers me immensely, it is outrageously false advertising:
When you buy your fancy top-end CPU, you expect stuff to run faster. Only it hasn’t been that simple since before the 386. Your new CPU isn’t really going to kick into gear until you get software that uses the shiny new features of your CPU.
In the case of Intel, they are very guarded about how their new features work. Probably because – as it happens – Intel also sells compilers: the software that programmers use to turn their text into machine instructions.
So your Intel CPU isn’t going to run anything at top whack until software companies have forked out for Intel’s compiler. Now, that’s a pretty nice deal for Intel, isn’t it? They sell the hardware that runs your software, which makes your user think your software isn’t running very well, because it doesn’t run very fast on the guys new hardware, unless you buy the software that Intel sells to make the hardware run the software properly. Ugh.
Their compilers are really good at optimizing code. We got a sizeable FPS increase in WWII Online just from switching to the Intel compiler.
But in just about every other aspect it’s a real pile of crap…