Sean, sybrandy, don, fawzi, tobias, gary, dsimcha, bearophile, russel, trass3r, 
dennis, and simen clearly have ideas how to work with parallel problems.

Ideas: Yes.
Expert: No. I haven't exercised it much as I haven't been able to do it at work. Others here have shown that they have more knowledge than I.

Sean mentioned:

"In the long term there may turn out to be better models, but I don't know of one 
today."

So he's basically saying that those others listed in the wikipedia pages are 
totally unsuitable for real world tasks? Only Erlang style message passing 
works?

It's the easiest to understand for the most part as it's very similar to how the real world works. Think about a coffee shop: two processes/people, let's call them Alice (customer) and Bob (barrista), are in the coffee shop. Alice is ordering coffee and Bob is making coffee. Alice tells Bob that she wants a super-duper-extra-foamy-mocha-hazel-choco-latte. E.g. she sends a message to Bob. Bob then does his magic and sends a message to Alice by handing her overpriced coffee.

So, from an understandability standpoint, it's very simple to understand. There are also other benefits that are best expressed in Joe Armstrong's thesis, which you can easily find online. He is one of the creators of Erlang and his thesis describes many of the benefits of the architecture.

Is it the best for all problems? No. For example, there are better tools for parallelizing loops. The Actor Model, which is what Erlang uses, doesn't work very well for this. There are other methods as well, but outside of auto parellelization and the actor model, they are harder to implement correctly, IIRC. There may be a couple I don't really know about.

Now, will any of these provide you with instant benefits in your apps? Probably not. Most software today was designed to run on one core and therefore doesn't use multiple cores very well. Firefox (3.6 and later), Chrome, IE 9, and I think the latest version of Opera all use multiple threads now mainly to keep certain pages/plugins from killing the entire browser, though you may notice some speedups just from that.

However, this does not mean that multiple cores are not benefiting you much. The OS is (should be) smart enough to distribute multiple apps across the cores, so you can have your browser and your word processor working hard and not have either one prevent the other one from getting any CPU time. The problem is that most of us don't have more than 2-4 apps working hard at any time, so past 4 cores you probably won't be getting much benefit in this respect. As threading becomes more popular and threaded apps are better designed, we should see a trend of better CPU usage on the desktop.

Casey

Reply via email to