[concurrency-interest] Basic Fork Join questions
dl at cs.oswego.edu
Wed Oct 12 08:17:30 EDT 2011
On 10/12/11 05:10, Mohan Radhakrishnan wrote:
> I am trying to understand the basic work stealing algorithm implemented in
> ForkJoinWorkerThread.java. There are references to some papers and Herlihy and
> Shavit’s book which I will read.
Yes. Without this background, it is probably impossible to
modify, extend or retarget the implementation.
> Do these two methods mainly implement the stealing part - deqTask() for other
> queues and locallyDeqTask() for own queue.?
deqTask is for steals. The standard path for processing local task
is popTask and its variants (locallyDeqTask is used only for
pools in async/fifo mode). However, there are several special
cases of these used throughout the FJ code.
> I am interested in looking at the running ForkJoin code in java.util.concurrent
> to get the queue size, tasks and stealing part using most probably AspectJ.
I'm not sure what this means, but like almost
everything else in java.util.concurrent, we supply enough
lower-level methods (including some "protected" ones in
ForkJoinPool and ForkJoinTask) that you should be able to
invent new ways of exposing higher-level functionality.
More information about the Concurrency-interest