This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: atomic operations for shared_ptr ?


On 24/08/2013 20:34, Bronek Kozicki wrote:

Perhaps spinlock could be implemented without breaking ABI? Please check
performance comparison figures at the end of this document:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2632.html

Here they suggest use "a spinlock pool keyed on a hash of the address of
the instance", although perhaps a special value of _M_ptr might be used
instead (that value being the address of _M_ptr itself).

Alternatively, a single bit might be sacrificed in existing data members
although that would most likely impose performance penalty on most
common uses, so I'm not really advocating it.

Scratch the part starting with "although perhaps a special value of _M_ptr", it just occured to me it will have exactly same performance effect on common uses as taking a single bit from existing data members (i.e. not good).


B.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]