dbtsai commented on PR #56377:
URL: https://github.com/apache/spark/pull/56377#issuecomment-4654778910

   Small follow-up to the race comment (commit `160eda7fd9f`). cc @viirya
   
   @viirya your linearization explanation is kept (it's the most concrete way 
to see the missed-entry case), but I refined one aside: the comment previously 
said the volatile read "on its own would be StoreLoad/Dekker-vulnerable." That 
isn't accurate under the JMM -- volatile accesses share a single total 
synchronization order consistent with program order (JLS 17.4), so the 
publish-then-recheck Dekker idiom over the volatile cache slot and 
`closedTimeMs` is sufficient on its own:
   
   > r1 sees 0 => R1 <so W2; r2 sees 0 => R2 <so W1; with program order W1 <so 
R1 and W2 <so R2 in the total SO, that gives the cycle W1 <so R1 <so W2 <so R2 
<so W1 -- a contradiction, so at least one read observes the other's write.
   
   (The StoreLoad/store-buffer vulnerability applies to unsynchronized/relaxed 
accesses, not Java volatiles.) Reworded the lead-in to state the guarantee 
accurately and dropped the "vulnerable in isolation" clause; the per-key 
linearization bullets are unchanged. Happy to revert if you'd rather keep the 
original framing.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to