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

WaitAndAdvanceHandle

struct WaitAndAdvanceHandle[work_origin: MutOrigin]

RAII handle for waiting on CLC barrier and advancing work iterator.

Uses the origin system (init/del) instead of context managers. The current work_info is captured on construction. On destruction, the prefetched next work is written back to the iterator's work_info.

Usage: var handle = work_iter.wait_and_advance_linear() process(handle.work_info) handle^.release() # After release, work_iter.work_info is the NEXT work item

Fields​

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

Implemented traits​

AnyType, ImplicitlyDeletable

Methods​

__init__​

def __init__(out self, work_info_ptr: Pointer[WorkInfo, work_origin], next_work: WorkInfo)

release​

def release(deinit self)

Release the handle and advance to next work.