[concurrency-interest] Java Memory Model and ParallelStream

Andrew Haley aph at redhat.com
Fri Mar 6 09:15:26 EST 2020


On 3/6/20 11:11 AM, Luke Hutchison via Concurrency-interest wrote:
> I realize
> that inlining doesn't just happen at compiletime, and the JIT could decide
> at any point to inline a function, but I want to ignore that (very real)
> possibility to understand whether reordering can take place across method
> boundaries _if inlining never happens_. Brian Goetz commented that "JIT
> regularly makes optimizations that have the effect of reordering operations
> across method boundaries" -- so I think the answer is yes. I just don't
> understand how that would happen.

The CPU *hardware* does this all the time. Few processors have a
total store order: x86, which does, is the exception here.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Concurrency-interest mailing list