simplify schedule logic#47
Merged
Merged
Conversation
ebcd29f to
1ab795f
Compare
1a70576 to
c08f02a
Compare
There was a problem hiding this comment.
Pull request overview
This pull request simplifies the schedule logic in the runtime by removing the eventfd-based notification mechanism and replacing it with a more streamlined approach using msg_ring operations. The changes eliminate the WorkType::Notify enum value and the AsyncWaiter class, which previously managed eventfd-based notifications for io_uring versions less than 2.12.
Changes:
- Removed
WorkType::NotifyandAsyncWaiterclass, simplifying the notification mechanism - Introduced
ThreadLocalRinghelper for synchronous msg_ring operations on older io_uring versions - Refactored
schedule()method with improved double-checked locking pattern for better performance - Changed runtime state management to acquire mutex during global queue flush and state transition for better thread safety
- Added comprehensive tests for cross-runtime and cross-thread
allow_exit()scenarios
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| include/condy/work_type.hpp | Removed WorkType::Notify enum value as part of notification simplification |
| include/condy/runtime.hpp | Major refactoring: added ThreadLocalRing and sync_msg_ring helpers, simplified schedule() and wakeup_() logic, improved state transition synchronization |
| include/condy/awaiters.hpp | Removed drain operation notification for io_uring < 2.12 |
| tests/test_work_type.cpp | Removed test case for the deleted WorkType::Notify |
| tests/test_runtime_options.cpp | Removed obsolete comment about eventfd+iopoll workaround |
| tests/test_runtime.cpp | Added new test cases for cross-runtime and cross-thread allow_exit() functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.