users@concurrency-ee-spec.java.net

[jsr236-spec users] Re: [jsr236-experts] Re: Support fork/join

From: Philippe Marschall <kustos_at_gmx.net>
Date: Sat, 01 Dec 2012 18:20:23 +0100

On 26.11.2012 20:54, Doug Lea wrote:
> On 11/26/12 14:23, Anthony Lai wrote:
>> Hi Philippe,
>>
>> Thanks for the suggestion. This is definitely a useful feature to have.
>>
>> Experts,
>>
>> While I think this is a valuable suggestion, I am not sure we could
>> fit this
>> requirement into Java EE 7 time frame. We might need to defer this for
>> the next
>> release, post Java EE 7. What do you think?
>>
>
> Deferring is probably OK, because for JDK8, there will be a
> (static) ForkJoinPool.commonPool() that anyone can submit to.
> In which case nothing is needed for EE. The main reason for this is that
> parallel versions of the JDK8 lambda-ized collection stuff
> need it. As in myCollection.parallel().filter(pred).map(m).reduce(r);
> So, basically, anyone can indirectly submit to it. And give that,
> there's no sense in not being upfront and adding commonPool method.

Forgive me my ignorance but unless this common pool is managed by the
application server I don't see how this helps. Imagine you have a
collection of JNDI names and want to parallel map the lookup. This will
likely fail because there won't be a context.

Sure you can wrap everything in callables that you pass through
ContextService but that feels kinda clunky.

Cheers
Philippe