Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class unbounded_fifo_queue

boost::log::sinks::unbounded_fifo_queue — Unbounded FIFO log record queueing strategy.

Synopsis

// In header: <boost/log/sinks/unbounded_fifo_queue.hpp>


class unbounded_fifo_queue {
public:
  // construct/copy/destruct
  unbounded_fifo_queue();
  template<typename ArgsT> explicit unbounded_fifo_queue(ArgsT const &);

  // protected member functions
  void enqueue(record_view const &);
  bool try_enqueue(record_view const &);
  bool try_dequeue_ready(record_view &);
  bool try_dequeue(record_view &);
  bool dequeue_ready(record_view &);
  void interrupt_dequeue();
};

Description

The unbounded_fifo_queue class is intended to be used with the asynchronous_sink frontend as a log record queueing strategy.

This strategy implements the simplest logic of log record buffering between threads: the queue has no limits and imposes no ordering over the queued elements aside from the order in which they are enqueued. Because of this the queue provides decent performance and scalability, however if sink backends can't consume log records fast enough the queue may grow uncontrollably. When this is an issue, it is recommended to use one of the bounded strategies.

unbounded_fifo_queue public construct/copy/destruct

  1. unbounded_fifo_queue();
    Default constructor.
  2. template<typename ArgsT> explicit unbounded_fifo_queue(ArgsT const &);
    Initializing constructor.

unbounded_fifo_queue protected member functions

  1. void enqueue(record_view const & rec);
    Enqueues log record to the queue.
  2. bool try_enqueue(record_view const & rec);
    Attempts to enqueue log record to the queue.
  3. bool try_dequeue_ready(record_view & rec);
    Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty.
  4. bool try_dequeue(record_view & rec);
    Attempts to dequeue log record from the queue, does not block if the queue is empty.
  5. bool dequeue_ready(record_view & rec);
    Dequeues log record from the queue, blocks if the queue is empty.
  6. void interrupt_dequeue();
    Wakes a thread possibly blocked in the dequeue method.

PrevUpHomeNext