-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-116738: Make mmap module thread-safe #139237
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it would be helpful in the long run to switch mmap
to AC rather than manually adding lock_held
functions everywhere.
Same question from my side: |
@ZeroIntensity, @corona10: Thank you both for the reviews, I agree that using AC with I wanted to ask for your preference: would you like to implement the switch in this PR, or should I hold off on this one and do the implementation separately, then continue with this PR after that? Alternatively, the switch could be done as a follow-up PR. Thanks! |
Let's do AC in this PR. |
These changes make the
mmap
module thread-safe for FT-Python by protecting themmap_object
against race conditions and undefined behavior. The goal is to provide behavior similar to standard Python builds with the GIL enabled, rather than makingmmap
fully deterministic or generally recommended for multithreaded use.cc: @mpage @colesbury @Yhg1s