atomic operations for shared_ptr ?

Marc Glisse marc.glisse@inria.fr
Mon Aug 26 11:05:00 GMT 2013


On Mon, 26 Aug 2013, Florian Weimer wrote:

> On 08/25/2013 01:52 PM, Oleg Endo wrote:
>
>> Just for my understanding, on targets that use 32 bit pointers and have
>> a 64 bit atomic (compare and) exchange, that would be a no-brainer,
>> wouldn't it?
>
> Unfortunately, no.  At least i686 requires 8-byte alignment for the pair, 
> while we currently only provide 4-byte alignment.  Similarly for x86_64, 
> where it's 16-byte alignment vs 8-byte.

If changing the alignment in the library would help, please make sure 
there is a PR open with the ABI keyword. There may be some form of ABI 
change in 4.10, though I don't know if it will be large enough to allow 
this...

(I hate binary compatibility taken too far)

-- 
Marc Glisse



More information about the Libstdc++ mailing list