Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Java Programming IT Technology

Scalable Nonblocking Data Structures 216

An anonymous reader writes "InfoQ has an interesting writeup of Dr. Cliff Click's work on developing highly concurrent data structures for use on the Azul hardware (which is in production with 768 cores), supporting 700+ hardware threads in Java. The basic idea is to use a new coding style that involves a large array to hold the data (allowing scalable parallel access), atomic update on those array words, and a finite-state machine built from the atomic update and logically replicated per array word. The end result is a coding style that has allowed Click to build 2.5 lock-free data structures that also scale remarkably well."
This discussion has been archived. No new comments can be posted.

Scalable Nonblocking Data Structures

Comments Filter:
  • Re:Java???? (Score:4, Insightful)

    by Anonymous Coward on Tuesday May 27, 2008 @04:35PM (#23561739)
    700 threads in C++? Why not use assembler, actually optimize the hell out of the code, and get it down considerably. Or get a lot more done per thread.

    Or... is this just a way to avoid having to get the really, really good coders who are more costly than the burn-bags?
  • Re:Java???? (Score:3, Insightful)

    by AKAImBatman ( 238306 ) <akaimbatman@g m a i l . c om> on Tuesday May 27, 2008 @04:41PM (#23561829) Homepage Journal

    700 threads in JAVA? Why not use C++

    Hmm... lemme think about that. Maybe because Java has decent threading support built into the language? Maybe because the platform is portable to any architecture? Maybe because the JVM can "optimize the hell" out of the running Java code far better than you could "optimize the hell" out of your C++ by hand?

    "Java is Slow" is a mantra that is easily 5+ years out of date. Java surpassed C++ performance many years ago, and by such a wide margin that no one even bothers running benchmarks anymore. Anyone repeating the "Java is Slow" mantra is merely branding themselves ignorant.
  • by rs232 ( 849320 ) on Tuesday May 27, 2008 @04:48PM (#23561949)
    Congrads Slashdot, you've managed to produce a story that is guaranteed to totally baffle the non-techie sector.

    KeyWords:

    concurrent data structures, hardware threads, java, large array, scalable parallel access, atomic update, words, finite-state machine, lock-free, data structures ...
  • Re:Java???? (Score:5, Insightful)

    by famebait ( 450028 ) on Tuesday May 27, 2008 @04:53PM (#23562027)
    There is no way anything less than _really_ good coders would get something like this to work with any semblance of efficiency. If you still evaluate coders by which language they use, chances are you're not really that good a programmer.
  • by Seferino ( 837142 ) on Tuesday May 27, 2008 @05:11PM (#23562311) Homepage
    This is interesting indeed. When reading the summary, it made me think about BSPML, although the slides make it clear that there are a number of differences. Essentially
    • BSPML doesn't limit itself to FSM but has full expressive power, including exceptions -- some implementations of BSPML use monads to solve things that this work solves by scaling down to a FSM
    • BSPML doesn't support dynamic changes to the number of threads
    • many BSPML algorithms are provable
    • BSPML is typically compiled to fully native code
    • BSPML doesn't use processor-specific concurrency-specific optimizations
    • BSPML works on distributed systems.
    • Despite the differences, both models work by sharing code and operating on a high-speed concurrent pseudo-vector, in a completely lock-free model (although locks can be implemented on top of the model, as usual).
      Just my .02 â.
  • Re:Sounds great! (Score:2, Insightful)

    by hasdikarlsam ( 414514 ) on Tuesday May 27, 2008 @05:13PM (#23562349)
    This still has limited applicability. Making a single data structure useful across hundreds of CPUs is impressive, but many problems can be more easily solved by using multiple structures - pipelining it, or using divide and conquer, or any of many other approaches.
  • Re:Java???? (Score:5, Insightful)

    by JMZero ( 449047 ) on Tuesday May 27, 2008 @05:22PM (#23562475) Homepage
    Java is perfectly fast for real world applications, and I'd agree that the "Java is Slow" idea is outdated.

    But it's not conclusively faster than C++, at least not in a general sense. In terms of a small task involving lots of simple operations, you'll still often see a significant speed increase using C++. This [multicon.pl] is a good example. Now I'm sure there's more optimizations available on both sides - and plenty of stuff to tweak - but C++ is going to come out ahead by a significant margin on a lot of these tasks.

    A good example where the participants on both sides have some motivation is on TopCoder (where I spend a fair bit of time). Performance isn't usually the driving factor in language choice there - but sometimes it is, and when it is the answer is pretty much always C++ (unless it's a comparison between Java BigInteger and a naive implementation of the same in C++).

    Reasonably often you'll see people write an initial solution in Java, find it runs a bit too slow, and quickly port it to C++ (or pre-emptively switch to C++ if they think they'll be near the time limit). It's not uncommon to see a factor of two difference in performance.

    To be clear - these are not usually "real world" tasks. As more memory and objects come into play, Java is going to do better and better. But these kinds of tasks still exist - there's still plenty of places where C++ is going to be the choice because of performance.

    In any case, your contention that Java is so much faster that nobody does benchmarks anymore is unsupported and wrong.
  • by CustomDesigned ( 250089 ) <stuart@gathman.org> on Tuesday May 27, 2008 @05:25PM (#23562527) Homepage Journal
    Yes, Java didn't surpass, but was competitive with C++ many years ago - at least as far as CPU goes. In fact, if you use gcj, you'll find that Java performance is *very* similar to C++ :-). For the IBM JVM, the turning point was JDK 1.1.6. I think having each thread allocate blocks of memory to dish out without lock contention was a big part of it. One interesting benchmark was this [bmsi.com].

    Now, before you C/C++ or Java fanboys get too excited, the absolute hands down fastest language on most of the benchmarks was LISP (I think it was Common LISP). I don't use LISP because I hate the syntax (and LISP fanboys regard it as a requirement of club membership that you like it). But the performance is quite impressive (with GC too), and that's what I would look into if I needed top performance from a high level language. Eat your heart out C++.

    I use Java quite a bit, and the biggest drawback performance wise is the amount of memory chewed up by the GC schemes and JIT. It is otherwise quite fast. I often turn off JIT to save memory (at the expense of CPU), and I would like to see options to use a GC algorithm that minimizes memory consumption (at the expense of CPU).
  • From the video... (Score:3, Insightful)

    by Zarf ( 5735 ) on Tuesday May 27, 2008 @06:10PM (#23563127) Journal
    Someone posted the video [google.com] and that was great. In particular I really like the use of a finite state machine as a proof of correctness. That might be a novel approach in this day and age when everyone is in love with UML. It makes you wonder if many of these things aren't made too complex by adding too much cognitive over-head. To hear Dr. Cliff Click talk it seems so trivial in retrospect. I suppose this is how you know his solution is elegant... I seriously doubt I'd have thought of it myself but when you see something elegant that seems natural afterward it's probably right.

    The other thing is that his algorithm shows a remarkable departure from traditional concurrent programming (as I learned it a decade ago) and he's not getting bogged down with locking and synchronize... instead he has a very simple "think about it" approach that uses the state machine as a thinking aide. Whom ever posted the video... thank you that was very enlightening. Perhaps many of these concurrency problems just need some creativity after all?
  • Re:Java???? (Score:3, Insightful)

    by samkass ( 174571 ) on Tuesday May 27, 2008 @09:28PM (#23565313) Homepage Journal
    So your argument is that with C/C++ you can make something almost as portable, almost as re-usable, almost as fast to write, almost as easy to debug, using a library selection that's almost as complete as Java. And in return you might gain a tiny bit of speed increase?

    And you're also postulating that there's more likely to be a fully standards-compliant C++ compiler with a standard thread interface on all those esoteric machines of which you speak than a basic JVM?

    I understand it's cool to hate Java on Slashdot, but sometimes I think the Java bashers are trying a little too hard.
  • Re:Sounds great! (Score:3, Insightful)

    by Pseudonym ( 62607 ) on Tuesday May 27, 2008 @09:46PM (#23565467)

    Researchers don't work at the fringes of what can be done "more easily". They work at the fringes of what is currently possible.

    Think about multi-tasking for a moment. If your problem is inherently sequential (e.g. everything is effectively sequentialised by a shared resource that can't be split, such as a piece of hardware), then you can use a single-process event loop. If your problem is inherently parallel (e.g. a web server), then you can use multiple forked processes. In otherwords: If your problem is easy, use an easy solution.

    But not every job is easy. That's why we have multi-threading.

    Similarly, these new data structures are designed to solve difficult problems.

Thus spake the master programmer: "After three days without programming, life becomes meaningless." -- Geoffrey James, "The Tao of Programming"

Working...