lua-users home
lua-l archive

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

Luiz Henrique de Figueiredo wrote:
> This is the expected behavior:  lua_error stops the execution 
> of the current Lua thread. In your case, there was no thread 
> to execute and so Lua was unable to recover and go back to 
> the host application. lua_error never returns!

OK, will work it out, thanks !

I have a somewhat unrelated follow up Question : The 
Manual says regarding lua_newthread:

"The new thread returned by this function shares with
the original state all global enviroment [...] but has an
independent runtime-stack."

I understand this as if changes to the globals, for instance
via lua_setglobal or lua_register, will be visible to all other
threads. But the manual again:

"Each thread has an independent table for globals"

That means IMO that each thread gets a copy of
the original state. This seem to be a contradiction 
to the sentence above or do I miss anything here ? 
Please clarify.

What I have in mind are multiple threads which share
a  mutable state. Or is this the job of the registry ?