folly::MPMCPipeline

A multi-producer, multi-consumer pipeline of processing stages.

Synopsis

Declared in <folly/MPMCPipeline.h>

template<
    class T,
    class... Stages>
class MPMCPipeline;

Types

NameDescription
Ticket Ticket, returned by blockingReadStage, must be given back to blockingWriteStage. Tickets are not thread-safe.

Member Functions

NameDescription
MPMCPipeline [constructor]Constructors
blockingRead Pop an element from (the final stage of) the pipeline. Blocking.
blockingReadStage Read an element for stage Stage and obtain a ticket. Blocking.
blockingWrite Push an element into (the first stage of) the pipeline. Blocking.
blockingWriteStage Complete an element in stage Stage (pushing it for stage Stage+1). Blocking.
read Try to pop an element from (the final stage of) the pipeline. Non-blocking.
readStage Try to read an element for stage Stage and obtain a ticket. Non-blocking.
sizeGuess Estimate queue size, measured as values from the last stage. (so if the pipeline has an amplification factor > 1, pushing an element into the first stage will cause sizeGuess() to be == amplification factor) Elements "in flight" (currently processed as part of a stage, so not in any queue) are also counted.
write Try to push an element into (the first stage of) the pipeline. Non-blocking.