lua-users home
lua-l archive

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


On Mon, Apr 14, 2003 at 10:02:56AM -0300, Roberto Ierusalimschy wrote:
> > why are lua_lock(), lua_unlock() and whatever macros?
> Overhead. To call a funtion (or simply check its existence) in every
> entry/exit to a Lua function is a waste for the majority of programs
> that do not need it. (Support for OS threads is not an "official"
> feature of Lua; it is more like a bonus.)

Couldn't two versions of the library be built then? One with the
macros defined as now and one with them defined to enable the kind
of interface I mentioned to set the callbacks? That way programs
could choose the kind of library they need without requiring
recompiles from the user if the OS distribution maintainer doesn't
provide a prepackaged version with e.g. LuaThreads (which doesn't
seem to work with the latest version, BTW) compiled in? Or maybe
a LuaThreads-enabled library should be made a bit easier to
compile (and be given another name so that both versions can coexist)?

-- 
Tuomo