Published Dec 03, 2006
Within the next couple of years, all modern desktop computers will have multiple CPUs, thanks to multi-core packaging. This doesn’t matter very much in the context of programming languages though until the number of CPUs crosses a certain threshold, say, 4-8 CPUs. There are a few reasons for this, including:
I have been waiting for multi-threaded programming to provide truly scalable performance gains for general computing ever since I started out developing software on IBM’s OS/2 operating system in the early 1990s. The crossover point has been “a few years” away for 15 years now, but now it’s so close I can smell it.
Researchers have long since developed the raw technology necessary to see us through this transition, but current tools are woefully lacking. Let me briefly describe the shortcomings of some of the tools we currently have available.
I alluded above to a division between two approaches to multi-threaded programming: 1) single-image and 2) message-passing. Right now, (1) is of primary importance (and the time to worry about it really is now). (2) is creeping up on us quickly though; I predict that it will really start mattering when we start dealing with anything more than about 8 CPUs. Why? Because in my experience, the only reliable approach to writing software that scales beyond 8 CPUs is to rely mostly on message passing.
Okay, here’s where I pull out my crystal ball. I predict that five years from now, the languages that provide the highest productivity with regard to multi-threaded programming will make message-passing easy (i.e. it will be the primary mode of multi-threaded development), and shared-image-based threading possible. Right now, none of the available languages I’m aware of provide this focus. What really concerns me though is that of the primary “scripting” languages, none are even close to providing the necessary programming infrastructure, let alone the appropriate focus on methodology. This is where my attentions are currently focused, and I expect many of my future ramblings will relate to the topic.
Two comments on Erlang multithreading
The latest release Erlang release can run threads on several different processes and you can start the emulator in hybrid mode which basically means that each thread has a private heap and also a message heap which is shared by all threads this makes it possible to pass messages by just copying a reference to the message.
On the last day of Christmas, my brother brought to me:
12 woefully lacking tools
11 layers of programming infrastructure
10 C++ pthreads
9 hackish programming solutions
8 CPUs
7 approaches to multi-threading
6 single-image programming models
Multi-threaded programming
4 future ramblings
3 low-level languages
2 years to the crossover point
And a crystal ball looking into the future of computer language
Interesting…since purchasing a dual core processor a couple of days ago, now that I’ve gotten a little bored of overclocking it I have been thinking about what options I have should I choose to try and concurrently program it.
I’m finding that my options are somewhat limited, with Java sounding like perhaps the best bet. In the past year I have been spending a lot of time with Ruby, and enjoying the language - apparently, its threading capabilities are lacking, but are you aware of the jRuby project, which is pure Java implementation of Ruby?
In this context viewing Java as a “low level” language makes sense.
An interesting tidbit about threading in Ruby + Java (jRuby):
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182382