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,567 of 33,346    |
|    Pete Becker to Alexander Terekhov    |
|    Re: atomic counter    |
|    15 Oct 11 08:56:22    |
      From: pete@versatilecoding.com              On 2011-10-15 12:16:45 +0000, Alexander Terekhov said:              > Increments for reference counting under basic thread-safety can be       > memory_order_relaxed without any fences.       > Decrements for reference counting under basic thread-safety can be       > memory_order_relaxed without memory_order_acquire fence for the case       > when resulting value of decrement == zero if referenced counted object       > is immutable.       > Decrements for reference counting under basic thread-safety can be       > memory_order_relaxed with more relaxed fence than memory_order_release       > for the case when resulting value of decrement != zero if referenced       > counted object is immutable. I call such a fence "sink load barrier"       > (release = "sink load barrier" + "sink store barrier").              All this recalls my original, somewhat tongue in cheek, objection to putting       thread support into C++: it encourages programmers to try to do things that       they don't understand.              Not that Alexander Terekhov doesn't understand this, but most people reading       this thread won't understand it (including me).              That's why most programmers should stick to sequentially consistent program       models. They're easier to analyze and easier to get right.              --       Pete       Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard       C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)                      [ 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