Skip to content

Conversation

yoney
Copy link
Contributor

@yoney yoney commented Sep 22, 2025

These changes make the mmap module thread-safe for FT-Python by protecting the mmap_object against race conditions and undefined behavior. The goal is to provide behavior similar to standard Python builds with the GIL enabled, rather than making mmap fully deterministic or generally recommended for multithreaded use.

cc: @mpage @colesbury @Yhg1s

@yoney yoney marked this pull request as ready for review September 22, 2025 15:01
Copy link
Member

@ZeroIntensity ZeroIntensity left a 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.

@corona10
Copy link
Member

Same question from my side:
Why don t we switch to use AC with '@critical_section'?

@yoney
Copy link
Contributor Author

yoney commented Sep 24, 2025

Same question from my side: Why don t we switch to use AC with '@critical_section'?

@ZeroIntensity, @corona10: Thank you both for the reviews, I agree that using AC with @critical_section would be a better.

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!

@ZeroIntensity
Copy link
Member

Let's do AC in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants