lua-users home
lua-l archive

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



On Aug 7, 2015, at 6:51 AM, Rena <hyperhacker@gmail.com> wrote:

I really hope a future Lua version will provide (or allow a module to provide in an unmodified Lua) true multithreading. With multi-core processors being so common now, not being able to make use of them is rather limiting. Even Python, the "batteries, charger and solar cells included" language, seems to have missed this boat - it provides "threading", but only one thread can actually run at a time (global interpreter state is locked while executing) and it doesn't sound like it'd be easy to fix without breaking other things.



I disagree. First, making Lua multi-threaded is bound to introduce considerable overhead (aka make it slower) .. for everybody, regardless of their needs for threading. Second, what is the benefit compared to using an external threading system across multiple Lua states? In our applications we have done just that, and we get all the benefits of a multi-threaded system, but also all the benefits of writing simple Lua code where you don’t need to worry about locks, monitors, inversions etc etc.

—Tim