在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?
答案 0 :(得分:5)
它取代了获取和释放GIL(它们处理切换线程)的函数,其中虚函数无效。请参阅相关的源代码:
默认情况下初始化线程切换为虚拟:
虚拟GIL功能:
https://github.com/unbit/uwsgi/blob/abac960e62700117cb96af3cd22e27e04242e096/plugins/python/gil.c