Today I can talk about a solution for all C++ programmers—a respected product enters a new era: Intel Threading Building Blocks (TBB) is now open sourced and supported by some very impressive veteran parallelism experts. Come check it out—threadingbuildingblocks.org.
When a programmer walks up to me and asks, "How do I get started with programming for parallelism?" what can I say? Good solutions have been limited. I usually recommend libraries that are threaded themselves and OpenMP immediately, yet for too many programmers these are not the answers they need.
What Is a C++ Programmer to Do?
Focusing on C++ programmers, what should I recommend? There really is a lack of general purpose answers other than TBB. Up until now, TBB has been a proprietary product from Intel.
In the year since its debut, it has become known by many in the C++ community as a well done option for parallelism for C++. The abstractions offered by TBB make parallel programming a reasonable option for most programmers. The reasons are three fold: it abstracts parallelism to a level that is easy to understand and add to a program (it is concise), it offers enough rigidity in how you express parallelism to shape your solution to be scalable and enduring, and finally it works well in practice (good performance obtained without endless expert tuning).
I liked it so much, I wrote a book about TBB (with lots of help and input). The good folks at O'Reilly Media liked it enough to have it be a Nutshell (animal) book with a canary on it. We'll have some fun with the bird theme— it is growing on us.
I want to work to see how much TBB, combined with the book, can be used to teach parallelism. Imagine teaching parallel concepts without having to describe the mechanics of threads and locks immediately. Yet, when you need to think about mutual exclusion, you can.
Today, July 24, 2007, Intel released TBB as a project complete with its source code (GPL v2 with the runtime exception). This changes TBB from a strictly closed-source proprietary solution to a product with an open source project. Intel will continue to sell and support the commercial product, but now you can get the identical capabilities by downloading the sources and building them yourself (or grab a pre-built binary if one is available for your system).
I'm part of a small team that advocated making this decision and convinced Intel to invest in this decision (by adding developers and resources to help make this happen, and agree to support us in real community engagement).
I advocated this project because our group has a passion for doing something about parallelism instead of just talking about what the industry needs to do. TBB is a great solution—and it only gets better now that it is free of any excuse not to use it.
Previously, Intel's product supported Linux, Windows, and Mac OS X. Naturally, some people asked about Solaris and other operating systems. Today it builds for Solaris and FreeBSD—and with open source, it is ready for ports to other operating systems.
Previously, Intel's product supported Intel and AMD processors. Some of our customers inquired about G5 processors and other processors. Today, it builds for G5 processors on Mac OS X. Again, with open source, it is ready for ports to other processors.
The maintainers are eager and willing to take back any changes to support more OSes and more processors.
As part of a team which is actually doing something about parallelism for C++, in a way which everyone can immediately benefit from, I'm quite happy.
This is just the start. There is much work ahead. Talk is cheap. Action is tough. We know it is going to be tons of work to really deliver on the full promise of TBB in the upcoming years. We are as ready as any group could be.
The TBB project is primed for action. We have a wish list for the project—and number one on the wish list is to be guided by the applications that use TBB. That will be a key principle of the project. The other principles will be to remain OS-, processor- and compiler-independent (in other words, to support them all). We'll tinker, and plan to have experimental TBBs on the side, but we want to keep TBB well defined, easy to learn and powerful.
Come check it out!