| C code needs to be updated to be safe in a GIL free execution environment. It is a lot of work! The pervasive problem is that mutable data structures (lists, dict etc) could change at any arbitrary point while the C code is working with them, and the reference count for others could drop to zero if *anyone* is using a borrowed reference (common for performance in CPython APIs). Previously the GIL protected where those changes could happen. In simple cases it is adding a critical section, but often there multiple data structures in play. As an example these are the changes that had to be done to the standard library json module: https://github.com/python/cpython/pull/119438/files#diff-efe... This is how much of the standard library has been audited: https://github.com/python/cpython/issues/116738 The json changes above are in Python 3.15, not the just released 3.14. The consequences of the C changes not being made are crashes and corruption if unexpected mutation or object freeing happens. Web services are exposed to adversity so be *very* careful. It would be a big help if CPython released a tool that could at least scan a C code base to detect free threaded issues, and ideally verify it is correct. |