Repository navigation
feat: v0.1.3 concurrency architecture hardening and defect remediation - #17
Merged
Merged
Conversation
- Fix AsyncRWMutex Free-Threaded data races with _depth_lock and out-of-lock wakeups - Native Condvar blocking send_sync/recv_sync in RawAsyncChannel and ReceiveChannel - Optimize NativeWorkerPool scheduling with AtomicMetrics batch additions and RwLock - Standardize cross-language ThreadPoolClosedError exception hierarchy - Enforce O(1) waiter unregistration and short-circuit RawAsyncChannel removals - Eliminate GC finalizer cross-thread re-entrancy in _TrackedCoroutine.__del__ - Event-driven worker dispatching and Condition drain barrier in EventLoopThreadPool - Cross-loop structured concurrency with TaskGroup(pool=...) and unified AsyncContext - Full docstrings, type stubs, and dual-language API documentation synchronization - Bump version to v0.1.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This release addresses concurrency code smells and architectural bottlenecks across 8 components in
multiloop, establishing formal state-machine invariants, thread safety under Python 3.14t (Free-Threaded / No-GIL), and bumping the version to v0.1.3:src/multiloop/rwlock.py):_reader_depthand_writer_taskwithself._depth_lock = threading.Lock()._wake_all()calls outside of the depth lock to prevent deadlocks.src/channel.rs&src/multiloop/primitives.py):time.sleep(0.0005)) with nativeparking_lot::CondvarinRawAsyncChannel.py.detach()during blocking waits.ReceiveChannel.recv_sync(timeout=None).src/metrics.rs&src/pool.rs):AtomicMetrics.add_global_pull(usize)for single atomic updates during batch pulls.NativeWorkerPool.metricstoparking_lot::RwLock.src/lib.rs,src/multiloop/exceptions.py,src/multiloop/pool.py):ThreadPoolClosedErrordirectly from PyO3 Rust extension._RustPoolClosedErrorsplit.src/multiloop/_channel_base.py&src/channel.rs):_discard_waiterviaOrderedDict.pop().src/multiloop/primitives.py& tests):self._wg.done()inside_TrackedCoroutine.__del__to prevent cross-thread deadlocks under multi-threaded GC.RuntimeWarningwhen unawaited coroutines leak.src/multiloop/pool.py):_worker_dispatcherwith pure event-drivennotify_event.wait().self._drain_barrier = threading.Condition(self._lock)for graceful shutdown.src/multiloop/_taskgroup.py&src/multiloop/context.py):poolsupport toTaskGroupwith isolated per-task childCancelScopeinstances.ExceptionGroupaggregation.AsyncContext.task_group(pool=...)lifecycle tracking and automatic cascading cancellation.__init__.pyitype stubs.docs/API.md↔docs/API_ZH.md).v0.1.3.Verification
tests/test_docs.py): 5 passed.make lintclean (ruff, mypy strict, pyright, clippy, cargo fmt).