-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msgq: refactor blocking recv for improved robustness and performance #616
Merged
Conversation
This file contains 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
dcf5f0b
to
040ebb4
Compare
040ebb4
to
d36d04c
Compare
d36d04c
to
c949a78
Compare
f1112ff
to
2cfd4de
Compare
2cfd4de
to
65b48b2
Compare
sshane
reviewed
Jan 18, 2025
63adf99
to
3fcc9f7
Compare
This doesn't work on Mac. Do you think it's worth implementing a mock |
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.
Replaced the previous method of installing, saving, and restoring signal handlers with a more streamlined and standard approach using signal masks (pthread_sigmask, sigtimedwait) for blocking receive operations. This update enhances the consistency and reliability of signal handling, aligning with best practices. It also removes the need for
msgq_poll
, thereby improving the efficiency of the receive function.Additionally, a new test case,
test_receive_interrupts_on_sigint
, has been added to confirm and verify the functionality of the updated signal handling.Since signal blocking is now managed in the C++ code,
nogil
is used in the Cython code to ensure the GIL is released during the execution of the receive function. This prevents it from impacting other Python threads.