Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2005-04-07 07:58:08


Peter Dimov wrote:
[...]
> ------------------------------------------------------------------------
> Name: sp_counted_base_gcc_ia64.hpp
> sp_counted_base_gcc_ia64.hpp Type: Plain Text (text/plain)
> Encoding: 7bit

: inline void atomic_increment( long * pw )
: {
: // ++*pw;
:
: long tmp;
:
: __asm__ ("fetchaddl %0=[%2],1" :
: "=r"(tmp), "=m"(*pw) :
: "r"(pw) :
: );
: }

That's implicit .acq by default, right?

Release incarnation is probably better. It merely "delays" increment
and doesn't hinder value prediction for subsequent loads and other
speculative stuff for "all" subsequent operations.

regards,
alexander.


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