|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 7 of 7
"Parallel code?" you may ask. "I don't need no stinkin' parallel code!" In the past, writing parallel code was specialized discipline, and most of us did not have parallel processing hardware in our basements.
However, most new workstations, servers, and laptops today have multicore CPUs. If you do have a dual core, quad core, or better setup and your software doesn't make use of it, then you are literally leaving computing power lying on your desk, your rack, or your lap.
The industry is quickly moving to tools and languages that make writing and running code in parallel across multiple cores easier, if not brain-dead simple. Languages are getting new constructs to aid multicore development, some as simple as looping directives that execute loops in parallel instead of serially. Functional languages in particular, like Erlang, Scala, and F#, are looked upon favorably because they lend themselves to parallel logic. For example, such languages have immutable objects by default, which enforces data safety across threads. Functional languages also encourage the other base principles that you've already seen discussed: atomicity, statelessness, and idempotence. Similar constructs are appearing in languages and frameworks that make parallel execution across distributed environments simpler too.
That said, most if not all distributed cloud-based environments allow you to run code in parallel today without waiting for special language constructs in Java (or whatever your own language du jour is). Indeed, due to their underlying execution models, some of these distributed environments also automatically take advantage of multiple cores on each compute node in an efficient way. And you don't have to adapt your code to get these benefits. This allows you to take your plain old Java objects and enable parallel execution across distributed computers while utilizing multiple cores.
Perhaps the largest challenge some face is choosing what code can be run in parallel. Again, tools are coming that will help in this respect. Some just identify the code sections for you; others will try to do it all automatically. However, whether or not you're aided by such tools, the code design principles you've seen in this article become more powerful when utilized together, and go a long way toward making your code into good parallel-ready code.
As you've walked through the design principles that will make your code cloud ready and multicore friendly, you've also gotten glimpses of the benefits that cloud computing platforms can bring to that code. In the second half of this article I'll explain what exactly we mean, when we talk about cloud computing. Find out how a distributed, cloud platform can bring scalability, reliability, and availability to your code with little or no intrusion.
Guerry A. Semones is a founding senior engineer and product manager at Appistry, a pioneer and leading provider of next-generation cloud application platforms. Guerry also serves as liaison to the Appistry Peer2Peer developer community. Find out more by reading his blog.
Read more about Enterprise Java in JavaWorld's Enterprise Java section.