Subject: Re: [boost] Boost.Atomic request for review/inclusion
From: Chris M. Thomasson (cristom_at_[hidden])
Date: 2010-01-30 19:20:31
"Ronny Spiegel" <ronny.spiegel_at_[hidden]> wrote in message
> I was looking for some kind of atomic counter which is able to deal
> with 64 bit values on 32/64 bit machines.
> I was just wondering if this could be done with this library on
> Windows (yes, I know). As far as I can see it uses the
> InterlockedIncrement() API methods internally. But for 64 bit values
> you have to use InterlockedIncrement64().
> Has anyone of you tried this?
FWIW, you can do a loop-free 63-bit counter on a 32-bit machine by using the
following clever algorithm from Joe Seigh:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk