lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


You need to use a Lua coroutine, and in the hook call coroutine.yield().

Create a coroutine, and set it's debug hook to be a count type, with a count of 100. Now your hook function will be called every 100 bytecodes. You just need to call coroutine.yield() in your hook.

On Tue, Dec 14, 2010 at 12:27 PM, Pastyl <pastyl5@prokonto.pl> wrote:
Jonathan Castello pisze:
> You might be looking for lua_sethook:
> http://www.lua.org/manual/5.1/manual.html#lua_sethook
>

Is any working examples?

>> I have a question. Is there any way to start, stop and then start it again?
>> I need to compile a program in lua, then execute 100 the user to do
>> something in C, and again to perform 100 instructions from lua, and
>> again to do something in C program in lua is free.
>> Something like lua_do100bytecode (L)
>>
>>
>>
>
>
>