Are synchronizes-with edegs compiler re-ordering barriers in both directions? Are synchronizes-with edegs compiler re-ordering barriers in both directions? multithreading multithreading

Are synchronizes-with edegs compiler re-ordering barriers in both directions?


Thanks to assylias for linking to this question which contains an answer with this image from the JSR-133 Cookbook:

Reordering Rules Table

According to this image the compiler transformation from EDIT 3 is illegal, because it reorders two MonitorEnters.

Also, this table shows which synchronization-edges are what kinds of "reordering-barriers" for which other operations.

Thank you for your help :)