IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

MBarPipeline

struct MBarPipeline[number_of_stages: Int]

Manages a paired set of producer/consumer mbarriers for pipeline synchronization.

Parameters​

  • ​number_of_stages (Int): Number of double-buffered pipeline stages, each with one producer and one consumer mbarrier.

Fields​

  • ​mbar (MBarType):
  • ​state (PipelineState[number_of_stages]):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

num_stages​

comptime num_stages = number_of_stages

Methods​

__init__​

def __init__(mbar: Pointer[SharedMemBarrier, MutAnyOrigin, address_space=AddressSpace.SHARED, _safe=False]) -> Self

init​

def init[*, num_producer: UInt32 = UInt32(1), num_consumer: UInt32 = UInt32(1)](self)

num_mbars​

static def num_mbars() -> UInt32

Returns:

UInt32

Was this page helpful?