If I remember correctly, we don’t have the logic that switches toanother task in a C function which called by LuaJIT. The OpenSSL co-routine
Hello!
Thanks for the response!
So you are having a situation like this:stack/execution state in the same thread).
1) Lua calls a C function (via Lua C api or FFI, doesn't matter for now).
2) That C function performs task switching (switches to a different C
3) Now another C function is executing.
4) It invokes Lua, or returns to Lua.
LuaJIT is not expecting this kind of reentrancy. Don't do it. Just don’t!
If I remember correctly, we don’t have the logic that switches to
another task in a C function which called by LuaJIT. The OpenSSL
co-routine (fiber) switched always by Nginx’s code.
If you are doing task-switching in a lua-C function, this will work,since lua-C function calls are never JIT-compiled. Make sure that the
following patches are applied to your LuaJIT:
https://github.com/tarantool/luajit/commit/ed412cd9f55fe87fd32a69c86e1732690fc5c1b0
https://github.com/tarantool/luajit/commit/5ccd25d740476a37d414733b5192d5be0ef06173
Thanks for the patches, I will try it!