Repository navigation
v3.2.0 — Extend synchronization suite with AsyncSemaphore, AsyncEvent, WaitGroup, and Cancellation primitives
Changes:
-
Added
usub::uvent::sync::AsyncSemaphore— coroutine-based counting semaphore for bounded parallelism and resource pooling.- Supports
co_await sem.acquire(),try_acquire(), andrelease(k)without blocking threads. - Lock-free design using atomic counters and waiter stacks.
- Supports
-
Added
usub::uvent::sync::AsyncEvent— coroutine-aware signaling primitive withReset::Auto(wake one) andReset::Manual(wake all) modes.- Allows efficient coroutine coordination without busy-waiting or polling.
- Compatible with
co_await event.wait(),set(), andreset().
-
Added
usub::uvent::sync::WaitGroup— coroutine barrier similar to Go’ssync.WaitGroup.- Supports
add(n),done(), andco_await wg.wait()for group completion synchronization. - All waiters resume cooperatively through the event-loop queue.
- Supports
-
Added
usub::uvent::sync::CancellationSourceandCancellationTokenfor cooperative coroutine cancellation.- Enables graceful termination of async tasks and timeouts.
- All registered waiters (
on_cancel()) are resumed instantly onrequest_cancel().
-
Unified documentation:
- New page
docs/synchronization.mdcovering all primitives (AsyncMutex, AsyncSemaphore, AsyncEvent, WaitGroup, Cancellation). - Each section includes design overview, example, API reference, and performance metrics.
- New page
-
Minor runtime adjustments to internal
system::this_thread::detail::qscheduling for improved coroutine resumption fairness under contention.
This release completes the coroutine-native synchronization layer for Uvent, providing a full set of non-blocking primitives for safe and efficient coordination inside the event-driven runtime.