Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] STM (was: Re: work times & accommodation @tokyo)



On 2008-07-28 05:54 -0700 (Mon), Josh Glover wrote:

> 2008/7/28 Curt Sampson <cjs@example.com>:
> 
> > I did plenty of thread programming in Java way back when, and it's truly
> > nasty stuff.
> 
> Indeed it is. They are trying to improve that in Java 7; I read a
> couple of articles describing the new fork/join framework:

Well, that's very nice and all, but not at all what I was talking about.
STM addresses what he calls "asynchrony," dealing with the locking
issues that were my nightmare of Java thread programming. The fork/join
framework doesn't address this at all.

What the fork join framework does address, parallelism, is quite
important, especially in this age machines with increasing number of
cores. Unfortunately for the Java folks, and anybody else using impure
languages, they appear to have no hope of catching up here. Parallism
is trivial in Haskell and other pure languages: GHC, has had for years
had a simple function, "par", and you simply apply it where you feel it
might help, with little change to the structure of your program.

(The reason parallelism is so trivial in pure languages is that, except
where the programmer explicitly requests that things be done in a
certain order, it doesn't matter to him the order in which operations
are done, so the compiler and runtime can feel free to rearrange the
calculations as they see fit.)

Here are some examples:

    http://cgi.cse.unsw.edu.au/~dons/blog/2007/11/26#no-headaches
    http://cgi.cse.unsw.edu.au/~dons/blog/2007/11/29#smoking-4core

cjs
-- 
Curt Sampson       <cjs@example.com>        +81 90 7737 2974   
Mobile sites and software consulting: http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links