uWSGI 如何禁用 Python GIL
How uWSGI disable Python GIL
在uWSGi文档中,有一句话说,If you start uWSGI without threads, the Python GIL will not be enabled, so threads generated by your application will never run
我想知道 uWSGi 是如何禁用 python GIL 的?
它用一个什么都不做的虚拟函数替换了获取和释放 GIL 的函数(它们处理切换线程)。查看相关源码:
默认情况下初始化线程切换到虚拟:
虚拟 GIL 函数:
https://github.com/unbit/uwsgi/blob/abac960e62700117cb96af3cd22e27e04242e096/plugins/python/gil.c
在uWSGi文档中,有一句话说,If you start uWSGI without threads, the Python GIL will not be enabled, so threads generated by your application will never run
我想知道 uWSGi 是如何禁用 python GIL 的?
它用一个什么都不做的虚拟函数替换了获取和释放 GIL 的函数(它们处理切换线程)。查看相关源码:
默认情况下初始化线程切换到虚拟:
虚拟 GIL 函数:
https://github.com/unbit/uwsgi/blob/abac960e62700117cb96af3cd22e27e04242e096/plugins/python/gil.c