[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to know if can I execute a yield
- From: Philipp Janda <siffiejoe@...>
- Date: Fri, 06 Mar 2015 12:33:41 +0100
Am 06.03.2015 um 12:00 schröbte Thierry FOURNIER:
I try to implement an execution timeout controller and a forced yield
to improve reactivity of my scheduler. I use the debug hook with an
instruction counter. In my hook function I try to run a yield.
This is useful to executing a forced yield and give the hand to my
main scheduler. This permits than a quite long Lua code doesn't block
my event driven process.
Sometimes the execution state is not yieldable. I sew the Lua code, and
this information seems to be contained in the "nny" variable. The C api
cannot give me the access to this variable.
It have a mean from the C api to know if I can execute a yield ?
Lua 5.3 has `lua_isyieldable` (or `coroutine.isyieldable` on the
Lua side). For previous Lua versions you are out of luck.