by Michael Voss and Wooyoung Kim
There are many ways to add parallelism to an application. For example, it’s very tempting to use the operating system’s native threading library directly on a multicore platform, such as WinThreads on Windows or Posix Threads on Linux. But this choice is a mistake. You’ll see why in the rest of this article. Instead, an important key to unlocking the performance potential of current and future multicore platforms is to choose a model that lets you express concurrency without requiring that you explicitly manage it. To do that, choose a high-level concurrency platform like Intel Threading Building Blocks (TBB), the OpenMP API, or any one of the many available data parallel languages.
By using these platforms, developers express the concurrency in their applications and let the runtime library manage the low-level, platform-specific details of implementing and scheduling concurrency on the hardware. That’s because the implementation and scheduling details will need to change as architectures change. By using a concurrency platform rather than a native threading library, applications are generally easier to write, are more likely to be correct, and can even gain performance as platforms evolve.
This article describes the process of adding parallelism to an example application using both a native threading library and the TBB library. You’ll see that using native threading requires more code, is more difficult to write, has more room for errors, and is less able to adapt to new architectures as they arrive.



1 response so far ↓
1 Express Parallelism, Don’t Manage It | insideHPC // Feb 27, 2009 at 3:35 pm
[...] Tip of the hat again to Multicoreinfo.com. [...]