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
Ring
struct Ring[depth: Int, producers: Int, consumers: Int]
One side's cursor over a ring of depth slots whose FULL count each of producers waves and EMPTY count each of consumers waves add 1 to per trip.
Fields
- words (
LPtr[UInt32]): - trip (
Int):
Implemented traits
Methods
__init__
def __init__(out self, words: LPtr[UInt32], word: Int)
acquire
def acquire(mut self) -> Int
The producer's slot for this trip, once its consumers freed it.
Returns:
commit
def commit(mut self)
wait
def wait(mut self) -> Int
The consumer's slot for this trip, once its producers filled it.
Returns:
release
def release(mut self)