Hacker News new | ask | show | jobs
by mkoubaa 243 days ago
I thought WSGI already used subinterpreters that each have their own GIL
3 comments

WSGI is just the protocol for web request handling (like CGI, fast CGI), some implementations utilized subinterpreter support through the C API (which existed in its basic form since Python 1.5 according to PEP 554 or since 2.2 according to the current docs)

but before 3.12 the isolation was not great (and still there are basic process-level things that cannot be non-shared per interpreter)

https://docs.python.org/3/library/concurrent.interpreters.ht...

This needs a lot of RAM with the speed/cores of modern CPUs. A GIL free multi threaded ASGI scales much further.
Subinterpreters are part of the Python standard library as of 3.13 (I think?).