I\'m new to C++ and am writing a multi-threaded app whereby different writers will be pushing objects onto a stack and readers pulling them off the stack (or at least pushing th
If you are running on Windows, SLIST implements a lockfree stack (with the structures SLIST_HEADER & SLIST_ENTRY).
The algorithm is implemented using fairly trivial push/pop singly linked list stack using interlocked functions. The only non-obvious item is the counter increment to avoid ABA issues.