Content-Length: 323915 | pFad | https://github.com/python/cpython/pull/104958

4A [3.11] gh-104372: Drop the GIL around the vfork() call. (#104782) by gpshead · Pull Request #104958 · python/cpython · GitHub
Skip to content

[3.11] gh-104372: Drop the GIL around the vfork() call. (#104782)#104958

Merged
gpshead merged 2 commits into
python:3.11from
gpshead:backport-d086792-3.11
Sep 1, 2023
Merged

[3.11] gh-104372: Drop the GIL around the vfork() call. (#104782)#104958
gpshead merged 2 commits into
python:3.11from
gpshead:backport-d086792-3.11

Conversation

@gpshead

@gpshead gpshead commented May 26, 2023

Copy link
Copy Markdown
Member

On Linux where the subprocess module can use the vfork syscall for faster spawning, prevent the parent process from blocking other threads by dropping the GIL while it waits for the vfork'ed child process exec outcome. This prevents spawning a binary from a slow filesystem from blocking the rest of the application.

Fixes #104372.

(cherry picked from commit d086792)


📚 Documentation preview 📚: https://cpython-previews--104958.org.readthedocs.build/

On Linux where the `subprocess` module can use the `vfork` syscall for
faster spawning, prevent the parent process from blocking other threads
by dropping the GIL while it waits for the vfork'ed child process `exec`
outcome.  This prevents spawning a binary from a slow filesystem from
blocking the rest of the application.

Fixes python#104372.

(cherry picked from commit d086792)
@gpshead

gpshead commented May 30, 2023

Copy link
Copy Markdown
Member Author

I want to let this bake in some 3.12beta releases for a while before applying it to a stable release. thus "draft".

@hauntsaninja

Copy link
Copy Markdown
Contributor

3.12 is now at RC stage; should we merge to 3.11?

@gpshead gpshead marked this pull request as ready for review September 1, 2023 08:26
@gpshead gpshead enabled auto-merge (squash) September 1, 2023 08:26
@gpshead gpshead merged commit 6ba1234 into python:3.11 Sep 1, 2023
@gpshead gpshead deleted the backport-d086792-3.11 branch September 4, 2023 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/pull/104958

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy