IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo struct

WaitAndAdvanceContext

struct WaitAndAdvanceContext[work_origin: MutOrigin]

Context for waiting on CLC barrier and advancing work iterator.

Encapsulates the CLC response barrier synchronization:

  • Construction: Waits for CLC response, fetches next work
  • enter: Returns current work_info for processing
  • exit: Assigns fetched work as current

Usage: with work_iter.wait_and_advance() as current: # current is the work item to process NOW process(current) # After exit, work_iter.work_info is the NEXT work item

Parameters

  • work_origin (MutOrigin): Memory origin of the work_info_ptr pointer (inferred).

Fields

  • work_info_ptr (Pointer[WorkInfo, work_origin]):
  • next_work (WorkInfo):

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable

Methods

__init__

def __init__(work_info_ptr: Pointer[WorkInfo, work_origin], next_work: WorkInfo) -> Self

__enter__

def __enter__(self) -> WorkInfo

Returns:

WorkInfo

__exit__

def __exit__(mut self)