Guest View: Java + multicore = good news
October 15, 2008 —
(Page 1 of 4)
Related Search Term(s): Java, multicore, software development
Dual-core processors are ubiquitous in desktop computers and laptops today; four to eight cores are common in servers, and within the lifetime of the next version of the JDK (Java 7), we are likely to see servers with dozens of cores become available in bulk.
Moore’s Law has given us unimaginable increases in computing power for more than over a generation. But a few years ago—as CPU thermal densities approached that of a small furnace—the strategy of cramming ever smaller transistors on chips that run at ever increasing frequencies seemed destined to hit a wall.
So chip designers pulled a new trick out of their sleeves: They leveraged the increasing transistor densities to fit more cores onto a single chip. While Moore’s Law continues to fit more transistors on chip, it is no longer a given that each new generation of CPUs will automatically run our existing algorithms faster.
It is now up to us to ensure that our code is ready to take advantage of the new generation of multicore CPUs. Our current theory, algorithms, languages and tools have all evolved around the sequential paradigm. The move to a truly parallel world will be a fundamental shift.
At first glance, the task of parallelizing our applications looks no different from multithreaded programming. The Java language is widely praised for having a simple yet powerful threading model that makes writing effective multithreaded applications mainstream. It may therefore seem likely that the ease of writing multithreaded applications will enable us to surmount the challenge of writing multicore applications, but in practice it may not be so easy.
The canonical multithreaded application in Java (such as the Web or application server) processes multiple users or connections concurrently, in multiple threads. That architecture is not only well understood, it is also very well supported by underlying frameworks, whether Web or application servers, to the extent that the average programmer hardly has to think about this issue. The complex tasks for thread pooling and scheduling are efficiently handled, and effectively hidden, by the framework. All we need to do as application programmers is write out servlet or Enterprise JavaBeans on the correct template, and we’re good to go.