Documentation Home >> Headers >> <jss/mpsc_fifo.hpp> Header >> jss::mpsc_fifo class template

jss::mpsc_fifo<> provides a multi-producer single-consumer FIFO queue. Multiple threads may call push() concurrently on the same instance, but only one thread may call pop().

jss::mpsc_fifo<> is an unbounded queue. When used with a lock-free memory allocator, the queue is lock-free, unless pop() is called on an empty queue, which will block. try_pop() and push() are always lock-free when used with a lock-free memory allocator.

namespace jss
    template<typename T>
    class mpsc_fifo
        mpsc_fifo(mpsc_fifo const&) = delete;
        mpsc_fifo& operator=(mpsc_fifo const&) = delete;


        template<typename U>
        void push(U&& value);
        T pop();
        bool try_pop(T& value);

        void poison();

#include <jss/mpsc_fifo.hpp>

See Also