You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Lua VM is completely single threaded with some cooperative multitasking support using coroutines. This will still saturate the main thread and limit performance.
Some multithreading frameworks exist (with significant code support on the native side), such as:
I think the rough idea is that we want to have one Lua VM for each thread, and utilise some kind of message passing protocol to communicate between the "threads". That means passing only basic Lua objects like strings/ints/etc that can be serialized/deserialized to bytes, essentially equivalent to a networking protocol but within a single process.
The text was updated successfully, but these errors were encountered:
Heavy tasks like iterating large tables or running functions that need to do so e.g. system creation will bring the main thread pretty much to a halt. This will make the game almost crash as it depends on the Lua VM to handle everything. Especially system & ship generation freeze the main thread until it's fully done and we can't simply pause / the user can't do anything else in the application while these are happening.
Also I can see things like the economy simulation etc being offloaded as these put unnecessary strain on the main thread.
While there are lots of things that can still be optimized in lua (already on it) we will eventually reach a ceiling which needs to be addressed sooner or later.
Currently, the Lua VM is completely single threaded with some cooperative multitasking support using coroutines. This will still saturate the main thread and limit performance.
Some multithreading frameworks exist (with significant code support on the native side), such as:
I think the rough idea is that we want to have one Lua VM for each thread, and utilise some kind of message passing protocol to communicate between the "threads". That means passing only basic Lua objects like strings/ints/etc that can be serialized/deserialized to bytes, essentially equivalent to a networking protocol but within a single process.
The text was updated successfully, but these errors were encountered: