omputing today is moving toward multi-core systems. A multi-core CPU allows the containing computer to exhibit the same thread-level parallelism as a system with multiple CPUs (see Figure 1
), which represents a huge benefit in overall system throughput for properly designed applications.
With manufacturers such as HP, Sun, IBM, Dell, and Apple offering systems with more than one multi-core CPUand Azul Systems even releasing a processor with 48 coresparallel computing is now available for mid-sized to large-scale servers, as well as for everyday desktop computers. So how do you as a developer adapt to this trend and best utilize it in your applications? First, you need to learn and employ new programming models and algorithms, and then find the proper tools and frameworks to effectively build, debug, unit test, and deploy these applications.
However, before getting into the available algorithms, tools, and frameworks, let's properly define parallel computing.
What is Parallel Computing?
Parallel computing is often confused with concurrency, where multiple individual tasks are executed simultaneously (e.g., the execution of more than one application (or multiple tasks) at the same time on a multi-processor system). Parallel computing, however, is more involved than simply creating multiple threads in your application. It is the execution of one task on multiple processors (or multiple-processor cores) at the same time, where both the processing and the results are highly coordinated.
|Editor's Note: The author, Eric Bruno, was commissioned to write this article by Pervasive Software, makers of DataRush. We have selected this article for publication because we believe it to have objective technical merit.
So while concurrency helps only with systems that perform many tasks simultaneously, such as web and application servers, parallel computing is ideal for applications that require you to break up the execution of a single task into pieces that can be executed in parallel and then combined, resulting in faster overall task processing.
The benefits of parallel computing include higher overall system throughput (an obvious one, since multiple tasks can execute without impacting one another), more efficient utilization of multi-core architectures, the ability to load balance tasks, and the use of other, more abstract, concepts such as pipeline parallelism and partitioning. Some applications that benefit most from parallel computing on multi-core SMP systems are:
- RFID-based applications that need to read gigabytes of data quickly
- Scientific and engineering applications that perform complex calculations on terabytes of data
- Data warehouse applications
- Distributed data-aggregation applications
- XML-based applications that involve large transformations
- Distributed real-time data-aggregation applications
Other benefits are not so obvious, and require OS and tool support. For instance, balancing task processing across processor cores based on individual core load can be beneficial, but it's tricky. As is pipeline parallelism, a related concept that provides even more benefits to overall performance.