With the advent of multicore processors such as the Intel Core Duo, which is now commonplace in PCs, software developers must deal with a new wrinkle -- getting software to be processed across multiple cores -- in order to ensure the maximum performance from their software. But this is much easier said than done, with developers having to tackle issues with concurrency and potential performance bottlenecks. Already, 71 percent of organizations are developing multithreaded applications for multicore hardware, according to a recent IDC survey sponsored by tool vendor Coverity.
Developers need to get an organization-wide commitment to accommodate multicore software development, advises IDC analyst Melinda Ballou. "They need to approach this with a level of commitment to better practices organizationally and from a project perspective for quality management [and] change management as well as development," she says.
[ Intel's Nehalem chip will push PCs further into a multicore world. InfoWorld's Tom Yager explains why Nehalem is such a game changer. ]
Multicore processors are becoming more prominent because single-core chips have maxed out on the heat and performance scale. Power-consumption issues also have driven development of multicore chips. Chipmakers such as Intel are adding cores to their CPUs. "Over the last 20 years of computing or longer, we've really been able to ride the wave of increased computing power through frequency scaling," says Lynne Hill, general manager of Microsoft's Parallel Computing Platform. But now, a wall (power consumption) has been hit, and hardware has to change if the processing capabilities of PCs are to increase, she says.
The hardware is in fact changing, which puts the burden on developers to adapt their applications to use it. Developers must learn new techniquesand use new tools to maximize performance.
That's because multicore processors work differently than single-core ones, processing multiple instructions in parallel. That means software has to break apart its instructions to be able to be processed in parallel as well. "When you have multiple cores, your program has to take advantage of all those cores, and it has to run instructions [on those cores] simultaneously," says Ben Chelf, CTO at Coverity, which offers tools for multicore development. "The challenge is that software never had to be designed to be run in parallel on multiple cores. It always just ran on a single core," says Ray DePaul, CEO of RapidMind, another provider of multicore-development tools.
Cliff Click, a distinguished engineer at Azul Systems who has offered technical presentations on issues with large concurrent programs, stresses the difficulties of writing multithreaded programs. "It's very hard, [but] it doesn't look that hard to begin with," he says.
Companies such as Intel, Microsoft, and Sun Microsystems are providing assistance with the multicore challenge and parallel programming.
Intel's Multicore App-Dev Aids
"Absolutely, [multicore software development is] a challenge. It's a pretty big challenge," says James Reinders, director of marketing for Intel's Developer Products Division. Concurrency is a major issue in development, he stresses. "When you write a parallel program, it's easy to make a program nondeterministic, meaning where different outcomes, or logic paths, are possible," Reinders says. Multicore app dev requires a much more complicated thought process about software design than most developers understand, he says. "By and large, the majority of programmers don't have experience with it and are in need of tools and training and so forth to help take advantage of it."
Intel is stepping in to assist developers who may not be able to deal with the paradigm shift on their own. The company offers its Threading Building Blocks template library to help C++ programmers with parallel programming. The Intel Thread Checker helps find nondeterministic programming errors, and the Intel Thread Profiler helps visualize a program to check what each core is doing. Also, Intel has a code library project called Ct, for C for Throughput, that looks at providing building blocks for common data parallelism cases.
Synchronization is important for parallel programming to avoid race conditions, Reinders notes. With a race condition, concurrent conditions aren't properly synchronized, so the order in which they complete affects the outcome. Program deadlocks also can occur: Instructions that execute in parallel each waits for the other to complete, so neither ends up completing.