[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_lock() question
- From: Dibyendu Majumdar <mobile@...>
- Date: Sat, 9 May 2015 20:15:47 +0100
On 9 May 2015 at 19:00, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> The lock is about the Lua interpreter,
> not about applications or libraries. When Lua calls C, it is in a
> consistent state and, from its point of view, it can be called from any
> thread without any problem.
Not sure if that is useful - as I would assume the only use case for
the lock is to prevent the same Lua state being used by multiple OS
threads at the same time. IMHO it is better to remove the lua_lock() /
lua_unlock() calls altogether and require that it is the
responsibility of the application calling Lua to ensure that no two
threads can concurrently access the Lua state.
Regards
Dibyendu