Asko Kauppi wrote:
Please try it together with Lua Lanes for multithreading. Lanes should take care of all the threading stuff, seamlessly (no locking).
Thanks for the suggestion Asko. I just went through the comparison of threading kits:
and conceptually Lua Lanes definitely seems more inline with what Roberto Ierusalimschy wrote in chapter 30 of "Programming in Lua" (2nd edition):
"Multithreading was developed for low-level programming. Synchronization mechanisms like semaphores and monitors were proposed in the context of operating systems (and seasoned programmers), not application programs. It is very hard to find and correct bugs related to multithreading, and some of these bugs can lead to security breaches. Moreover, multithreading may lead to performance penalties related to the need of synchronization in some critical parts of a program, such as the memory allocator."
I would much rather see something like Lua Lanes find it's way into the bundled optional libraries, than something like Lua Thread. I'm sure there are seasoned programmers out there that won't be happy, but Lua was designed for people who aren't professional programmers... and the fact that were talking optional packages means the pros could drop it for another option.