begin quoting Andrew Lentvorski as of Tue, Apr 03, 2007 at 03:46:25PM -0700: > Here is a video talking about Azul Systems lock-free hash table for > Java. It's quite a good example of different thinking about concurrency. > > http://video.google.com/videoplay?docid=2139967204534450862
I hate video for this sort of thing. So I snagged the PDF. http://www.azulsystems.com/events/standford_2007/2007_LockFreeHash.pdf They only offer psuedo code for the get(), not for the put(), which is slightly annoying. Still, it seems pretty clever, but the trick seems to be that keys are (a) immutable and (b) persist, and something called CAS. I'm not familiar with "CAS", and it took a bit of poking to figure out it was "Compare And Swap" (thanks to a link to "Lock-Free Programming on AMD Multi-Core Systems" in google's cache). So instead of Test And Set, we have Compare And Swap as our atomic operation. Okay. This is less clever than it first seemed, as it's a new atomic instruction. Still, this sort of atomic instruction offers some interesting ways to tackle concurrent programming problems -- and is the sort of thing that probably _ought_ to be introduced into concurrent languages. Atomicity is the hard nut. If we could have a language that had atomic sections, we'd probably have a lot more fun with concurrent programming. I'd *love* to be able to say: atomic { do_something(); do_something_else(); } But that's probably a really hard feature to implement. :) -- I still want to see their put() method. Stewart Stremler -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
