Boost logo

Boost :

Subject: Re: [boost] [lockfree::fifo] Review
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2009-12-10 20:25:45


>
> Tim, have you read the replies to my post on c.p.t regarding ABA bits?
> Even on this thread someone (I think Helge) argued that even 32 bits may not
> be enough. Now I'm thinking that maybe "generation counter" solution may not
> be workable as a general solution.
>

For ABA, overflow (or wraparound, really) shouldn't be a problem. All
you are trying to do is make sure you don't see the same pointer
twice, while in a CAS. Seeing the same pointer twice does happen, but
not that often. What are the chances that not only will it be the
same pointer, but also that the 32 bits have wrapped around back to
the same value? I would suspect that the CAS'ing thread must have
suspended for quite a while in order for the 32 bits to loop around,
and on top of that, to hit the 1 / 2^32 chance of landing on the same
value...

>
> Andy.
>

Tony


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