Use free-threaded Python with Granian
masterGranian supports free-threaded Python (experimental). When using a free-threaded build:
- Workers are threads instead of separate processes, meaning a single Python interpreter is shared across all workers.
- The application is loaded once and shared.
- For ASGI and RSGI, each worker runs its own AsyncIO event loop within its worker thread.
- For WSGI, GIL-related limitations are theoretically absent.
Warning: Free-threaded support is experimental and highly discouraged in production. Granian will refuse to start if the GIL is enabled on a free-threaded build.