[concurrency-interest] Conja-- an accidental jsr166y alternative

David Soergel dev at davidsoergel.com
Thu Nov 19 00:39:42 EST 2009


Hi all,

I wrote a Java concurrency library a while back before I knew about jsr166y, and finally got around to writing up how it works.  I realize I'm very late to the party here, but still I hope some of the ideas I implemented may interest you. 

The main advantage of my library that I see at the moment is that it hides all the hard stuff behind syntactic sugar, and so should be very easy for a novice to adopt.  I suspect it would be straightforward to provide a similarly easy-to-use wrapper around the jsr166y internals.  I haven't yet done a detailed comparison though, so it may well be that jsr166y provides functionality that Conja lacks.

The project home page is at http://dev.davidsoergel.com/trac/conja/, and the most important design issues are described briefly at 
http://dev.davidsoergel.com/trac/conja/wiki/PrinciplesOfOperation

A couple of those issues are: 1) I schedule nested tasks in depth-first order, with advantages much like work stealing; 2) I employ various strategies to conserve memory (primarily by not leaving tasks waiting around in queues); and 3) I construct Runnables lazily and concurrently from an iterator of task inputs.  One consequence is that "pipelines" consisting of nested mapping iterators (i.e., iterators that apply a function to elements from an underlying iterator) can be used to provide the inputs, in which case the mappings are computed lazily and concurrently.

I've been using this for some time with excellent performance, so I think it works at least :)

Looking forward to any feedback you may have,

-ds


_______________________________________________________
David Soergel                            (650) 303-5324
dev at davidsoergel.com        http://www.davidsoergel.com
_______________________________________________________





More information about the Concurrency-interest mailing list