Boost logo

Boost :

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
news:d81ab4001001290608i31bed028u1d843faaa433ce33_at_mail.gmail.com...
> Hi,
>
> 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:

http://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/15271b4da40460b7


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