Tuesday, January 31, 2012

Why C++ and where to look

The theme of this blog is finding out how programming will have to change to deal with computers containing dozens or hundreds of processors. So far most of the posts have been related to Clojure. In addition to Clojure, F# and C# also have good answers to parallelism.

The approach in all three of these languages is to write applications that can be run in parallel safely, so that you can benefit from having multiple processors without breaking anything. In all three cases, the actual hardware is abstracted away.

In addition to the number of processors in a machine though, we are also seeing a diversity of processors being used within a single machine. Graphical Processing Units are very powerful, but their vector processing gives a bigger boost to some operations than others. GPUs and other chips have reduced instruction sets, which means that some code that is perfectly legal on a CPU won't work on a GPU.

Reducing the number of clock-cycles and choosing lower power processors are important whether you are trying to increase the battery life of a mobile device or having to power (and cool) a server farm. Cloud computing, which provide CPUs as a metered service, also encourages using cycles sparingly.

If you want to be optimizing cycles and choosing chips you need to be running "on the metal" and that means C or C++.

There have been a lot of changes to C++ in the C++ 11 specification. There are also new libraries that deal specifically with the problems of developing on different types of chips. When even Microsoft, with their traditional focus on drag and drop development and managed code, starts talking about a C++ renaissance you know it is a big deal.

Microsoft is hosting a 2 day "Going Native" event on February 2nd and 3rd. The event is being streamed live (for free) at http://channel9.msdn.com/Events/GoingNative/GoingNative-2012. I am sure they will also have videos of the keynotes and sessions available later on the channel 9 site.

I will not watch it live (I am still trying to learn Clojure), but it is timely information, so I thought I would pass it along.

No comments:

Post a Comment