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: volatile qualifier hurts single-threaded optimized case


On 8/30/06, Paolo Carlini <pcarlini@suse.de> wrote:
Benjamin Kosnik wrote:

>   static inline _Atomic_word
>   __attribute__ ((__unused__))
>-  __exchange_and_add_dispatch(volatile _Atomic_word* __mem, int __val)
>+  __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
>
>
Agreed, but doing this means that in the improvements to rope that
Richard (and Hans) also want we have to call __exchange_and_add and
__atomic_add directly,  because in that case the involved memory
locations are volatile and have to remain like that per Hans desiderata,
I gather. More generally, the original __exchange_and_add and
__atomic_add could be used also together with volatile memory and now
calling the "old" functions becomes necessary, we should document that
somewhere (if it weren't for this reason, everyone should always go
through the dispatchers).

Luckily rope is stupid and does not use atomic ops at all, but uses a mutex and manual increment/decrement. So rope is not an issue (until it gets atomic ops).

Richard.


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