Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1001 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 1001 Bytes

Collections of Queues

  • blocking_queue: a blocking queue for multi-producer-multi-consumer systems

    • usage:
      auto* bq = new newplan_toolkit::BlockingQueue();
  • spsc_queue: an asynchronious queue for single-producer-single-consumer systems [high-performance]

    • usage:
      • create

        auto *spsc_q = new newplan_toolkit::SPSCQueue(102400);
      • insert

        spsc_q->push(data); 
      • pop

        new_data = spsc_q->blocking_pop();//blocking
        
        do {
            recv_ptr = spsc_q->front();//non-blocking
        } while (recv_ptr == nullptr); 
        spsc_q->pop();

Other Useful Implementations