| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Doesn't free-threading perform a stop-the-world when importing modules?
Sorry, something went wrong.
|
A better question is: do we guarantee that it will always stop the world? |
Sorry, something went wrong.
|
We stop the world, temporarily enable the GIL, then resume (but with only one thread now holding the GIL), and the run the C extension initialization code. I think you might still need the locks in this example because of isolated sub interpreters each with their own GIL. We haven't explicitly guaranteed the stop the world behavior, but it'll probably be difficult to change in the future. |
Sorry, something went wrong.
Subinterpreters switch to the main interpreter to import an extension, so the GIL synchronizes it. |
Sorry, something went wrong.
Well, that's something I'd like to change for 3.15 :) Let's play it safe and keep our options open? |
Sorry, something went wrong.
|
I'll yield, but I'm worried that it would break too much code to be feasible (or worth doing). I think all third-party extensions currently assume no other threads, right? Maybe we could make this opt-in. |
Sorry, something went wrong.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
…e Isolation HOWTO (pythonGH-134141) (cherry picked from commit 1f0a294) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
…e Isolation HOWTO (pythonGH-134141) (cherry picked from commit 1f0a294) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
|
GH-134491 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
GH-134492 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…e Isolation HOWTO (pythonGH-134141) Co-authored-by: Sam Gross <colesbury@gmail.com>
…e Isolation HOWTO (pythonGH-134141) Co-authored-by: Sam Gross <colesbury@gmail.com>
…e Isolation HOWTO (pythonGH-134141) Co-authored-by: Sam Gross <colesbury@gmail.com>
…e Isolation HOWTO (pythonGH-134141) Co-authored-by: Sam Gross <colesbury@gmail.com>
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--134141.org.readthedocs.build/