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 don't want to use locking, you need to use a lock-free stack. This is actually not that hard (lock-free queue is more difficult). You do need a platform-specific compare-exchange primitive, such as InterlockedCompareExchange on Windows, but this isn't hard to abstract.
See here for an example in C#:
http://www.boyet.com/Articles/LockFreeRedux.html