Boost logo

Boost :

From: terekhov_at_[hidden]
Date: 2001-11-17 13:51:33


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> In order to make shared_ptr thread safe (w.r.t. reference counting)
we need
> an atomic_counter type, with the following operations defined:
>
> atomic_counter a(n); // n is the initial value, convertible
to 'long'
> ++a; // atomic increment, returns the new value (by value,
type 'long')
> --a; // atomic decrement, returns the new value (by value,
type 'long')
> a; // convertible to long, atomic read (to support use_count() and
unique())
>
> See below for a proposed implementation.
>
> Comments are welcome.

info.

http://www.cs.umd.edu/~pugh/java/memoryModel/archive/0855.html
(Java: VOLATILE-ACQUIRE memory semantics == mutex.lock memory
semantics; VOLATILE-RELEASE memory semantics == mutex.unlock
memory semantics)

http://groups.google.com/groups?as_umsgid=3BC8463D.6E23002A%40web.de
("READ MEMORY BARRIER" == mutex.lock memory semantics)

regards,
alexander.


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