[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Threading headaches
- From: Stefan <stefan@...>
- Date: Fri, 06 Nov 2009 17:43:02 -0800
Cosmin Apreutesei wrote:
Do you really need
"thread-safe" builds of these libs when using each instance of the modules
only from the Lua state that requir()ed it? Or am I just getting lucky?
AFAIK, a shared library can only be loaded once (i.e. have one global
state) per process. If only that weren't true, many stateful libs
would become thread-safe automatically and the Lua C API wouldn't need
a state argument.
Indeed. I found out I actually was a little bit lucky - FreeBSD by
default enables thread safety on everything possible in the port tree.
I will add it to the luafcgid README. All linked libs in the modules
must be threadsafe. Does anyone know of any common Lua modules that are
not usually threadsafe? This way I could list them.