Main
The Other Mainstream

« HTML 5 : We don't need no XHTML | Main | Choosing an AJAX framework : Think graphic designers, usability experts and web services »

July 24, 2007

Concurrent programming : Getting a stronger language in Erlang.

Its likely you've dealt with concurrent programming at one point in your career, how would you know ? 'Multi-threading', 'Deadlocks', 'Synchronized blocks', 'Shared memory' would all be subjects related to concurrency. Though concurrency tends to be an after-thought under most circumstances, its been getting a fair share of attention due to the processor architectures -- hyperthreading & multicore -- which are making their way to the market.

[Entry continues to the left and below ad ]

A real life example of concurrency playing a pivotal role in development would be best explained by the classical example: "A banking application used to withdraw money preventing that two or more processes/programs accessed cash simultaneously, resulting in a possible loss". In development, all kinds of precautions are taken to avoid these cases, such as using locks or synchronized blocks, guaranteeing if you will, only a single line be formed to get to the teller.

Seen one programming language, seen them all

Concurrency is not a new problem, all the major programming languages -- namely Java, C# and Perl, among others -- have artifacts to deal with it. Though support has always been there, using concurrency has generally been somewhat of a pain, even the latest Java version is still incorporating 'new' mechanisms : Concurrent Programming with J2SE 5.0 , not to mention, concurrency is also one of the main points behind C Omega a research language being developed at Microsoft. So why is concurrency such a hot topic all of a sudden ? And one which can't be dealt using your favorite programming language, difficult as it may be ?

Processors, Processors, Processors

I won't spoil you the complete read, so here is the link The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software . But in case your short on time, I'll sum up: It goes on to say how the architectures being used in processors -- namely those of hyperthreading & multicore -- will require the use of concurrent software in order to truly milk-out what these processors were made out to do.

Its somewhat over the top with "(Concurrency)The biggest sea change in software development since the OO revolution" and granted it was written in 2005 which is ages ago in Internet time, it will prove to you that concurrency has wider implications than those typically confronted in development, which are more of the preventive type used to avoid unsuspecting errors, rather than the proactive type used to make better use of processing cycles -- make multiple lines to the various available tellers so they don't go idle -- the latter of which will evidently become more common given the presence of these processor architectures.

Erlang : Concurrency in mind

Er..what ? Erlang is a language initially designed inside Ericsson -- the telco Co -- which has one notable characteristic if your dealing with concurrency : Its processes have no shared memory and communicate by asynchronous message passing., a rough equivalent to saying a language has no threads, which means that concurrency programming gets a whole lot easier.

Though I am not ready to say Erlang is the best programming language I've seen, or that I'll write my next web-desktop application with it, I've barely made a few "Hello World" examples. If its concurrent programming you want and a language that was designed with concurrency in mind, Erlang should be the strongest choice in terms of this type of programming.

Update: Here is an interview with Joe Armstrong -- the inventor of Erlang -- done at JAOO 2007, its half-an-hour long, and talks about object orientated programming, threads, concurrency, processors, memory and hardware, among other things: http://channel9.msdn.com/ShowPost.aspx?PostID=351659

[Comments below ad ]

Posted by Daniel at July 24, 2007 11:57 AM


Comments


Post a comment




Remember Me?

(you may use HTML tags for style)

Track back Pings

Track Back URL for this entry:
http://www.webforefront.com/mtblog/mt-tb.cgi/81.

 
XHTML 1.1   Powered by Movable Type 3.33