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,420 of 33,346   
   Alexander Terekhov to Michael   
   Re: Double checked locking pattern artic   
   26 Aug 11 19:20:04   
   
   27c09a75   
   From: terekhov@web.de   
      
   Michael wrote:   
   [...]   
   > In fact, with C++11, all of the problems go away if you change the   
   > declaration of pInstance to:   
   >   static std::atomic pInstance;   
   >   
   > *viola*   
      
   Sequentially consistent atomic (C++11 default for atomic) is an overkill   
   for a typical "double checked locking pattern" using a pointer   
   (dynamically allocated object).   
      
   C++11 has more better suited   
   std::memory_order_consume/memory_order_release (albeit, frankly, I just   
   can't grok associated std::kill_dependency() thing).   
      
   Elsewhere in this thread...   
      
   Andy Venikov wrote:   
   [...]   
   > In the C++0x (or should we start calling it C++11 ?) ...   
      
   C++0xB sounds much uglier than C++11. :-)   
      
   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