Boost logo

Boost :

From: Tim Blechmann (tim_at_[hidden])
Date: 2008-05-16 15:33:40


> 1. Lock-free free list (workarounds ABA problem).

i didn't read all the code, but in tagged_ptr::set you write:

Type vTag = m_p[1]; // NOTE: getting 'tag' before getting 'data'!
Type vOld = m_p[0];

... i am not sure, whether it is necessary to get tag before data, but if
you need to do that, you have to add a memory barrier, otherwise compiler
or cpu may reorder the memory access ...

btw, if you are using the stack just as free list, i don't think you need
any aba prevention ... also, what about grabbing the code from my
freelist implementation?
http://tim.klingt.org/git?p=boost_lockfree.git;a=blob;f=boost/lockfree/freelist.hpp

cheers, tim

-- 
tim_at_[hidden]
http://tim.klingt.org
Which is more musical, a truck passing by a factory or a truck passing
by a music school?
  John Cage

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