RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Multi-Core Mythbusters : Page 3

Some pervasive myths about running Java applications on multi-core systems are misleading developers, and it's time to shine the bright light of truth on these falsehoods.

The "Concurrent Computing Has To Be Hard" Myth
Almost nothing scares a developer like the idea of explicitly dealing with the concurrency problems of multiple threads (or multiple machines), because concepts such as "deadlock," "livelock," "starvation," or "deadly embrace" are outside the core expertise of most application developers. And even if a skilled engineer knows how to handle these situations, it's not the ideal use of his or her time.

This has sparked resurgent interest in new ways to deal with concurrency, ranging from new language-based approaches (e.g., OpenMP or JR) to new approaches to languages altogether (e.g., functional languages like F# or Scala). While creating an entirely new language offers some unique opportunities to deal with concurrency in elegant ways, the thought of learning an entirely new programming language—much less a new platform—can be overwhelming to a developer.

Fortunately, building applications for concurrency doesn't have to be a task only rocket scientists, brain surgeons, and astrophysicists can perform. By understanding even some of the basic principles of how parallel processing best works (immutable objects rather than objects with mutable state and guarded code regions, making copies of shared state, and so on), developers can build applications to take advantage of multiple processors with relatively little work.

Of course, if one has a library or tool available to help ensure and enforce some of these design decisions, all the better. With the appropriate tools, a developer can not only mitigate the risks associated with rewriting multi-threaded code, but preserve the flexibility and agility of the application environment as well.

The Not-So-Mythical Java App on a Multi-Core System
Now that you can discern between myth and fact, taking advantage of the parallelism implicit in today's and tomorrow's multi-core CPUs doesn't have to mean subtle and irreproducible threading bugs, which consume thousands of man-hours only to disappear at debug time. Taking some straightforward steps to design more parallelism-friendly applications and using tools that help guide and enforce those design principles should make building a parallelism-friendly application as simple as building, say, an application that stores data into a relational database.

Oh, and if you're considering busting that Mentos-and-Diet-Coke-produce-spectacular-gushing-fountains myth, don't try it at home. Trust us; that one's a scientific fact. Hopefully this warning saves you from having to explain to your significant other why there's Diet Coke on the floor... and the walls... and the ceiling. Now, if you'll pardon us, we're curious to know if the metal-in-the-microwave-will-blow-it-up myth is true, and there happens to be an old microwave oven in the garage...

Cory Isaacson was most recently president of Rogue Wave Software. Cory has been actively involved in leading information technologies since 1985, starting as the founder and chief executive of Compuflex International. He has been providing guidance to IT professionals in the development and implementation of powerful business applications throughout his career.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date