Parallelism : Is your code cloud-ready and multi-core friendly? (part 5)

As part of an ongoing series, we are discussing design principles that influence how ready our code is for distributed  computing in the cloud, as well as for multi-core utilization. Today, we talk about…

800px-Café_wall.svgParallelism

"Parallel code?" you ask, "I don't need no stinkin' parallel code!" In the past, writing parallel code was an area of specialization, and most of us did not have a parallel processing computer with specialized hardware in our basements.

However, most new workstations, servers and laptops today have multi-core CPUs. However, even If you do have a dual core, quad core (or more) setup and your software doesn't utilize it, then you are leaving computing power lying, literally, 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 multi-core 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 encourage the other base principles that we have discussed earlier: 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, .NET or your language du jour. 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 and .NET objects (POJOs and PONOs) 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, tools or not, the code design principles we have been discussing become more powerful when utilized together, and go a long way toward making your code a good candidate for being good parallel-ready code.

As we've discussed the design principles to use in our code to make it cloud ready and multi-core friendly, we've also touched on the benefits that cloud computing platforms can bring that code. Next time in part six, we'll conclude this series by discussing what a cloud computing platform is, and how such a platform can bring scalability, reliability, and availability to your code with minimal or no intrusion.

In the meantime, if you'd like to learn about what cloud computing is and what parts make up cloud computing technology stack, download our white paper "Unlocking the Promise of Cloud Computing for the Enterprise."

Is your company considering using cloud computing? On premise as a private cloud? Or, off premise in the public cloud?

Reply

The content of this field is kept private and will not be shown publicly.