Re-enable Move Subinterpreter test for free-threaded Python 3.14 (#5940)

* Remove skip for Move Subinterpreter test on free-threaded Python 3.14+

* Fix deadlock by detaching from the main interpreter before joining the thread.

* style: pre-commit fixes

---------

Co-authored-by: b-pass <b-pass@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Ralf W. Grosse-Kunstleve
2025-12-23 12:32:41 +07:00
committed by GitHub
parent 7ae61bfb82
commit 799f591ec3
2 changed files with 13 additions and 9 deletions

View File

@@ -492,4 +492,8 @@ Best Practices for sub-interpreter safety
So you must still consider the thread safety of your C++ code. Remember, in Python 3.12
sub-interpreters must be destroyed on the same thread that they were created on.
- When using sub-interpreters in free-threaded python builds, note that creating and destroying
sub-interpreters may initiate a "stop-the-world". Be sure to detach long-running C++ threads
from Python thread state (similar to releasing the GIL) to avoid deadlocks.
- Familiarize yourself with :ref:`misc_concurrency`.