[concurrency-interest] ForkJoin updates
dl at cs.oswego.edu
Sun Mar 4 18:41:36 EST 2012
On 03/04/12 18:30, Alex Lam S.L. wrote:
> On Sun, Mar 4, 2012 at 10:35 PM, Doug Lea<dl at cs.oswego.edu> wrote:
>> 3. One small API addition: Explicit support for task marking.
>> It was cruel to tell people that they could use FJ for things
>> like graph traversal but not have a simple way to mark tasks
>> so they won't be revisited while processing a graph (among a few
>> other common use cases). Because they weren't supported initially,
>> marking methods need crummy names that won't conflict with
>> existing usages: markForkJoinTask and isMarkedForkJoinTask.
> Actually, now that I read this again - by conflicts do you mean
> inconvenience when modifying existing user code, or do you mean
> existing applications will break?
The convention we operate under is that if you add new methods
to existing subclassable library classes, then you have to pick
names that no existing subclass could conceivably have used.
Even still, it amounts to a bet that no programmer on the planet
has such poor taste to pick such a crummy name.
I think that bet is safe with compareAndSetForkJoinTaskTag
Upcoming extension methods in JDK8 will help with more cases along
these lines, but even if they existed, we'd probably do it this
way in this case.
More information about the Concurrency-interest