Boost logo

Boost :

From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2007-09-30 13:33:11


Michael Marcin wrote:
> Phil Endecott wrote:
>> Ion Gazta?aga wrote:
>>> Since there is no atomic operations library in Boost I use my own atomic
>>> operations (taken from apache):
>>>
>>> http://svn.boost.org/svn/boost/trunk/boost/interprocess/detail/atomic.hpp
>>
>> It would be great to make this a publicly-visible library, rather than
>> an implementation detail of interprocess. That would avoid duplication
>> of effort in e.g. shared_ptr.
>>
>> Note that recent-ish versions of gcc have builtins for atomic
>> operations on many platforms.
>
> Have you seen Matt Calabrese's work?
>
> http://lists.boost.org/Archives/boost/2007/07/124651.php

No I hadn't seen that; thanks for pointing it out.

While trying to find the 'asm', or whatever it uses, I must say that I
have never seen quite so many levels of #includes! I have spent a
while looking but I can't find what's actually at the bottom of it all...

Based on my recent experience of adding ARM asm to shared_ptr, all that
I would want from an Atomics library is something that wraps the gcc
builtins when they exist, otherwise falling back to something like
Ion's existing apache-based code - with some macros or other indication
of whether the implementation for each function is asm or a more
expensive emulation.

There may well be applications for a library like Matt's, but I would
prefer it to be implemented on top of a more primitive, but accessible, layer.

Regards,

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk