Re: (hypothetical? bogus?) TSAN failure reported in ForkJoinPool (JDK11 and "refresh" versions)

Doug Lea via Concurrency-interest <[email protected]> Sat, 18 Jul 2020 06:33:04 -0400
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
This now looks like a simpler issue than I was thinking...

On 7/17/20 2:19 PM, Chris Povirk wrote:
>
> So, to provide the edge we need, I gathered that the /worker thread/ 
> has to do something. And I see now that I was misunderstanding its 
> weakCompareAndSet: I had read the docs on (JDK8) 
> AtomicReference.weakCompareAndSet 
> <https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html#weakCompareAndSet-V-V->, 
> which provides no ordering guarantees. But I see that that name has 
> been deprecated as misleading 
> <https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/atomic/AtomicReference.html#weakCompareAndSet-V-V->, 
> and the /VarHandle/ weakCompareAndSet 
> <https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/VarHandle.html#weakCompareAndSet-java.lang.Object...-> (the 
> one that's used in ForkJoinPoo.scan 
> <http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ForkJoinPool.java?revision=1.355&view=markup#l1566>) 
> /does/ provide ordering guarantees.

Yes, prior to JDK9, the only supported weakCompareAndSet method was weak 
in both the sense of spurious failures and  ordering. But there are now 
multiple versions, and the one used here has ordering equivalent to 
compareAndSet on success. (The package-level docs were changed 
accordingly, to reference VarHandle docs.) So externalPush has memory 
semantics of lock-unlock.

-Doug

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest