Skip to content

gh-137219: Export _PyEval_StopTheWorld and _PyEval_StartTheWorld #137220

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Jul 30, 2025

@pablogsal pablogsal added the needs backport to 3.14 bugs and security fixes label Jul 30, 2025
@pablogsal pablogsal requested a review from colesbury July 30, 2025 00:33
@pablogsal pablogsal changed the title gh 137219 pythongh-137219: Export _PyEval_StopTheWorld and _PyEval_StartTheWorld Jul 30, 2025
@pablogsal pablogsal changed the title pythongh-137219: Export _PyEval_StopTheWorld and _PyEval_StartTheWorld gh-137219: Export _PyEval_StopTheWorld and _PyEval_StartTheWorld Jul 30, 2025
@pablogsal
Copy link
Member Author

@hugovk are you ok exposing this in rc2 in the FT build? Without these these APIs tools cannot add proper free threaded support when they need to have hard sync points

@pablogsal
Copy link
Member Author

I am not changing the name for now so we can backport them (if @hugovk is ok with it) to 3.14 in the private headers. We can do another PR for 3.15 exposing them as unstable APIs outside private headers

@colesbury
Copy link
Contributor

For memray, I think you should be able to use _PyEval_StopTheWorld(interp), which is already exposed (instead of _PyEval_StopTheWorldAll()).

_PyEval_StopTheWorld() stops all the threads in an interpreter
_PyEval_StopTheWorldAll() stops all the threads in all interpreters

We don't use _PyEval_StopTheWorldAll much. We use it before fork() because that's process-wide, but most things including sys.setprofile() use _PyEval_StopTheWorld().

@hugovk
Copy link
Member

hugovk commented Jul 30, 2025

@hugovk are you ok exposing this in rc2 in the FT build? Without these these APIs tools cannot add proper free threaded support when they need to have hard sync points

Okay to backport provided someone else approves the PRs, and no-one from the C-API Workgroup objects.

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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy