Open RussellLuo opened 6 years ago
Related issue: https://github.com/unbit/uwsgi/issues/1605
In gevent (and other async modes) main loop engine actually does not use thunder-lock (there is no thunder_lock
macro call). I don't know why.
Only normal ("simple") and "rbthreads" loop engines are using thunder_lock
.
Simple loop code (simple_loop_run
function) is here: https://github.com/unbit/uwsgi/blob/2.0.17/core/loop.c#L117
Function simple_loop_run
calls wsgi_req_accept
(https://github.com/unbit/uwsgi/blob/2.0.17/core/utils.c#L1484) which calls thunder_lock
macro.
Async loop code (async_loop
) is here: https://github.com/unbit/uwsgi/blob/2.0.17/core/async.c#L408
Function async_loop
(and asyncio_loop
, tornado_loop
etc) calls wsgi_req_simple_accept
(https://github.com/unbit/uwsgi/blob/2.0.17/core/utils.c#L1453) which does not call thunder_lock
macro.
Phenomenon
1. Using thunder-lock alone works well
2. Combining gevent with thunder-lock does not work
Question