help understanding release sematics
David Holmes
david.holmes at oracle.com
Mon Nov 7 04:15:36 UTC 2016
On 7/11/2016 1:09 PM, 恶灵骑士 wrote:
> Hi,
>
>
> in OrderAccess
> inline void OrderAccess::storestore() { release(); }
> inline void OrderAccess::loadstore() { acquire(); }
> the storestore can complete release sematics why some blog saying that release sematics include both storestore and loadstore?
You are looking at a particular platform's implementation where the two
things are the same at the hardware level. Conceptually it is the wrong
way to express it.
In orderAccess.hpp we define:
acquire() == loadLoad|loadStore
release() == loadStore|storeStore
This is a particular definition inside hotspot such that we define an
equivalence between these pairs:
release_store(&x, 1) → release(); x = 1;
and
y = load_acquire(&x) → y = x; acquire();
In the more general literature this equivalence does not exist as the
two statements could be reordered.
acquire/release can not be exactly expressed using loadload/loadstore etc.
I actually have a presentation on all this that I just did last week. I
plan to add a few updates then make it available.
David
>
>
> i can understand what blog say but i am a little confused by the code.
>
>
> thank you !
>
>
> Arron
>
More information about the hotspot-dev
mailing list