lua-users home
lua-l archive

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


I was thinking of adding thread support to my application (the Ion
window manager) that was recently converted to use Lua for configuration
and scripting. Threads would be needed in some Lua callbacks for tasks
that scan the file system and should not block the app from processing
other events. The problem in implementing this is that it appears that
the user would have to recompile the Lua library to support threads.
So, my question is why are lua_lock(), lua_unlock() and whatever macros?
Wouldn't it make more sense to add a function lua_setthreadfns(), say,
that could be called runtime to set callbacks for these if threads are
needed?


PS. As I'm new on this list--and to Lua--I must say that in the short
time I've used the language, I've really begun to admire it.
The standard libraries need more work and functions, though.

-- 
Tuomo