home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,341 of 33,346   
   Pete Becker to itaj sherman   
   Re: atomic memory_order with command or    
   29 May 12 19:21:30   
   
   8af76ef8   
   From: pete@versatilecoding.com   
      
   On 2012-05-30 00:39:27 +0000, itaj sherman said:   
      
   >   
   > Right, it doesn't order x, I didn't mean for it to. The point was for   
   > x to   
   > cause a synchronization (an optional one) on the fences. So that   
   > stores that   
   > were sequenced before the release fence, be certainly visible to loads   
   > that   
   > happen after the acquire fence.   
      
   That's not quite right. The fence causes the synchronization. But the   
   only way for the second thread to know that the synchronization has   
   occurred is to see the value that the first thread wrote into x. So   
   from a coding perspective, once you read the correct value, you know   
   that all the stuff that happened before the fence is visible in your   
   thread. If you haven't read the correct value it could simply because   
   the other thread hasn't gotten there yet.   
      
   --   
    Pete   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca