[concurrency-interest] Handling DAGs with JSR166

Doug Lea dl at cs.oswego.edu
Tue Nov 16 07:37:29 EST 2010

On 11/16/10 07:20, Niko Matsakis wrote:

> So, I did a bit more reading into the code and in particular looked at those
> examples actions you gave. Am I correct that {Binary,Linked}AsyncAction still
> don't allow "lateral" joins? By a lateral join, I mean a case like I outlined
> previously, where one node joins its siblings in the "fork tree" (i.e., the tree
> formed by considering which task forked every other task).

Right. These classes maintain parent pointers only. It is possible
to maintain arbitrary links and use them in conjunction with
join counts or phasers. (An example slightly
closer to what you want is "FJSums" demo; see also
"TorusSpanningTree", both in src/test/loops in our CVS).
In general, when you have data structures that are not
statically shaped as trees/dags, you need to mix the
data-structure maintenance with execution control,
normally using something other than ForkJoinTask.join.
Which can get messy. This should be better documented.
We'll work on it.


More information about the Concurrency-interest mailing list