
Where is the magic? Can you point to some documentation or how to use it?
It seems to make the assumption that volatile variable reads and writes are atomic. This, among with careful organization of those operations, allows safe concurrent access.
This sort of assumption looks wrong. volatile should only instruct the compiler not to optimize the variable (e.g. in a register).
the ringbuffer is known not to be smp-safe without memory barriers ... btw, i have a boost-style lockfree fifo class [1], with support for multiple concurrent producers/consumers ... i haven't found the time to make it ready for a submission, yet ... cheers, tim [1] http://tim.klingt.org/git?p=boost_lockfree.git -- tim@klingt.org http://tim.klingt.org Art is either a complaint or do something else John Cage quoting Jasper Johns