lua-users home
lua-l archive

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


On Tue, Apr 13, 2004 at 10:46:16PM -0700, Mark Hamburg wrote:
> For preemptive C threads, what I'm currently doing is generating a lua_State
> per C thread and using a single mutex managed by lua_lock and lua_unlock to
> coordinate amongst them. This means that at most one thread can be actually
> executing within the Lua universe at once.

i'm curious to know why you need lua_lock/lua_unlock if you have a
distinct lua_State per C thread, since from the Lua core's point of
view they shouldn't interfere - do they need to serialize access to
some shared non lua_State state ?

thanks