[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: coroutine.yield from debug hook in LuaJIT 2
- From: Greg <tghill@...>
- Date: Mon, 13 Jun 2011 19:21:07 +0000 (UTC)
> For Lua you need to set it on each coroutine separately. This can
> get difficult, because you are not notified when a new coroutine
> is created. For LuaJIT you only need to set it once and it applies
> to all coroutines.
> The line hook is very, very inefficient. Never use it, except for
> debugging! Use the count hook with a high number. Or better yet,
> set the count hook with a count of 1 from a timer (signal or other
> thread). And keep it off most of the time, i.e. disable it as soon
> as the hook is called. Otherwise everything will slow down.
This makes sense. Where I am running into problems is with:
debug.setlocal ([thread,] level, local, value)
I'm assuming this doesn't have thread level control in LuaJIT 2. I want
to set a local variable for a corroutine but I can only seem to
reference the main thread.