[concurrency-interest] Visualize parallelism

Kasper Nielsen kasper at kav.dk
Wed Feb 16 09:12:28 EST 2011

Actually, I don't how useful it would be to wrap ForkJoinTasks.
Unlike ThreadPoolExecutor which uses Runnable.run() ForkJoinPool uses 
ForkJoinTask.exec() which is protected. This makes it difficult to 
create generic wrappers,
Any reason not to make ForkJoinTask.exec() public?


On 16-02-2011 14:26, Kasper Nielsen wrote:
> I looked into creating something like this.
> But it proved a bit more cumbersome that I had expected because
> everything in ForkJoinPool&friends is final or private/package protected.
> FJP needs some methods similar to beforeExecute and afterExecute
> on ThreadPoolExecutor to make this happen.
> Something like
> ForkJoinPool.beforeExecute(ForkJoinWorkerThread thread, ForkJoinTask task);
> ForkJoinPool.afterExecute(ForkJoinWorkerThread thread, ForkJoinTask
> task, Throwable t);
> would be a good start.
> Also FJP.forkOrSubmit(Task) is private so its cumbersome
> to wrap tasks, because you have to override every execute() and submit()
> method in ForkJoinPool. At least make the execute() methods delegate to
> the submit() methods.
> Cheers
> Kasper
> On 16-02-2011 08:01, David Holmes wrote:
>> Are you looking for something that would show you the task graph that
>> gets created? I don't know of any such tools, though it would be
>> interesting to know a few basic facts about the graph when tuning your
>> algorithms.
>> The ability to use different cores is just a consequence of
>> multi-threading. There's nothing specific to FJ about that - it will use
>> as many cores as it has threads with work to do.
>> David Holmes
>> -----Original Message-----
>> *From:* concurrency-interest-bounces at cs.oswego.edu
>> [mailto:concurrency-interest-bounces at cs.oswego.edu]*On Behalf Of
>> *Mohan Radhakrishnan
>> *Sent:* Wednesday, 16 February 2011 4:52 PM
>> *To:* concurrency-interest at cs.oswego.edu
>> *Subject:* [concurrency-interest] Visualize parallelism
>> Hi,
>> This is a newbie question.
>> What is the recommended way to visualize how the FJ API’s
>> parallelism is able to use different cores ? Is there a Windows tool
>> for visualizing it at that level ?
>> Is any tool like this used by the team to test the API ?
>> Thanks,
>> Mohan
>> _______________________________________________
>> Concurrency-interest mailing list
>> Concurrency-interest at cs.oswego.edu
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

More information about the Concurrency-interest mailing list