skeeto / lstack

C11 Lock-free Stack
The Unlicense
179 stars 27 forks source link

ABA counter #5

Open inspirit opened 9 years ago

inspirit commented 9 years ago

To protect against ABA issues it is sufficient to only update the counter in pop operation, isn't it? Might be wrong though...

skeeto commented 9 years ago

That's true, we only need to count either pops or pushes, not both. In order to re-use a pointer, it needs to be popped and pushed back on. Right now I'm just using it as a state-change counter.