Mojo module
ring_buffer_traits
Trait definitions and utilities for ring buffer synchronization strategies.
This module provides:
- SyncStrategy trait: Interface for producer-consumer synchronization protocols
- SingleCounterSync: Uses a single atomic counter per tile (original RingBuffer behavior)
- SplitCounterSync: Uses separate producer/consumer counters to reduce contention
- Atomic utility functions for thread-safe counter operations
Structs
-
SingleCounterSync: Single counter synchronization strategy. -
SplitCounterSync: Split counter synchronization strategy.
Traits
-
SyncStrategy: Interface for synchronization strategies between producers and consumers.
Functions
-
increment_counter_if_first_thread: Atomically increment counter, but only from the first thread in warp. -
wait_for_counter: Spin-wait until counter reaches threshold.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!