Computer-science wisdom says that a lock-free FIFO (queue) is the right way to synchronize shared data between two threads in a lock-free manner. I know what a queue is and how the lock-free property is accomplished, however: how a FIFO queue solves the problem? How to practically use it? What data should go into it? Could you provide some pseudo-code?