Boost logo

Boost Users :

Subject: Re: [Boost-users] non incremental use of atomic_counter
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2010-11-19 12:14:57


michi7x7 <mailing-lists <at> michi7x7.de> writes:

> Hi,
> you can easily do this using Boost.Atomic and intrusive_ptr:
>
http://www.chaoticmind.net/~hcb/projects/boost.atomic/doc/atomic/usage_examples.html#boost_atomic.usage_examples.example_reference_counters
> It should be easy to make (un-)reference and counter-operations
> atomic using this ;)

Looks very promising.

How would I increment reference count atomically by 1000? Like this?

 x->refcount_.fetch_add(1000, boost::memory_order_relaxed);

I gather this is not Boost library yet, right? What's plan for that? Can I use
it in my code?

How portable is it now?

Thank you

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net