
"Peter Dimov" <pdimov@mmltd.net> writes:
One argument against your enhancements is that (to the untrained eye) they seem to mandate a lock-based implementation. I wanted to permit a lock-free implementation, if possible.
Guilty as charged. At the time I designed this class, I had never studied lock-free programming techniques. The focus on these "front" handles came partly from thinking about std::stack's and std::queue's top()/front() and pop() separation. Just as exception safety requirements prevent these two operations from being merged, concurrency requirements prevent them from being separated -- without some kind of a lock. I haven't thought it through much, but I doubt the same idea (exclusive by-reference access to the queue head) could translate to a lock-free interface. -- Steven E. Harris