[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to know if can I execute a yield
- From: Thierry FOURNIER <tfournier@...>
- Date: Fri, 6 Mar 2015 13:15:40 +0100
On Fri, 06 Mar 2015 12:33:41 +0100
Philipp Janda <siffiejoe@gmx.net> wrote:
> Am 06.03.2015 um 12:00 schröbte Thierry FOURNIER:
> > Hello,
>
> Hi!
>
> >
> > 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`[1] (or `coroutine.isyieldable`[2] on the
> Lua side). For previous Lua versions you are out of luck.
Great, thank you. My Lua implementation is currently in
development/beta, so I can make big changes and upgrade the version.
Thierry
> >
> > Thank
> > Thierry
> >
>
> Philipp
>
> [1]: http://www.lua.org/manual/5.3/manual.html#lua_isyieldable
> [2]: http://www.lua.org/manual/5.3/manual.html#pdf-coroutine.isyieldable
>
>
>