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 31,421 of 33,346   
   Alexander Terekhov to Dave Abrahams   
   Re: Double checked locking pattern artic   
   26 Aug 11 19:20:54   
   
   From: terekhov@web.de   
      
   Dave Abrahams wrote:   
   [...]   
   > Note: don't assume that just because you have only a single CPU or core   
   > you are safe from these effects: compiler writers generally assume that   
   > your code deserves no more protection from cross-thread confusion just   
   > because your threads are running on a single core, and they don't go out   
   > of their way to make sure you'll observe sensible effects unless you   
   > correctly use the special CPU instructions to ensure that your threads   
   > have a consistent view of the world.   
      
   No, compiler reordering aside, no special CPU instructions regarding   
   memory ordering/barriers are needed if a multithreaded program is   
   restricted to run on a single core/uniprocessor (not have more than one   
   thread running at the same time). For a uniprocessor, all fences/barrier   
   instructions can be just ignored (they are not needed). If you have   
   contrary evidence, please point to it.   
      
   regards,   
   alexander.   
      
      
   --   
         [ 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