Note that there are some explanatory texts on larger screens.

plurals
  1. POsynchronizes-with, happens-before relation and acquire-release semantics
    primarykey
    data
    text
    <p>I need help in understanding synchronizes-with relation. The more I'm reading it an trying to understand example, the more I feel that I understand nothing. Sometimes I feel that here is it, I've got it, but after looking at another example I get confused again. Please help me to get it right.</p> <p>It's said that an operation A synchronizes-with an operation B if A is a store to some atomic variable m, with release semantics, B is a load from the same variable m, with acquire semantics, and B reads the value stored by A. It's also said that an operation A happens-before an operation B if</p> <ul> <li>A is performed on the same thread as B, and A is before B in program order, or</li> <li>A synchronizes-with B, or</li> <li>A happens-before some other operation C, and C happens-before B</li> </ul> <p>OK. If we look at this example</p> <p>thread0 performs | thread1 performs</p> <hr> <p>store x (release) | load x (acquire)</p> <p>does store to x here synchronize-with load from x? If we do have synchronizes-with relationship here, then store to x happens before load from x, so everything what is sequenced before store to x in thread 0 happens-before load from x in thread 1. It means there is enforced ordering here. Is it right? But in this case I don't understand what does the "and B reads the value stored by A" part of definition mean? If thread 1 is faster then thread 0 it may read the old value. So what is the relationship here and is there any relationship at all? If there is no, how can I provide that relationship?</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload