|
Boost : |
Subject: Re: [boost] [lockfree::fifo] Review
From: Chris M. Thomasson (cristom_at_[hidden])
Date: 2009-12-18 08:48:42
"Gottlob Frege" <gottlobfrege_at_[hidden]> wrote in message
news:97ffb310912101725w14104d84n8bdeeebeed2d7345_at_mail.gmail.com...
> >
>> 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...
Although, it would _definitely_ suck if the race-condition hit! I am way to
paranoid...
lol.
;^)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk