Originally Posted by
Weissrolf
Thanks for chiming in, well appreciated.
Both rulesets and extensions do not have to be loaded by the main thread, though, even when they need to run in the main thread. FGU proves that itself, because the everything loaded as "Load Part 1" is not loaded by the main thread. So no problem keeping the UI alive and displaying a busy animation via main thread.
Then I wonder what "LUA engine" means? I assume that the LUA scripts are not interpreted but compiled by a JustInTime compiler? Does that compilation of multiple scripts/ruleset/extension files have to be done in sequence by a single thread?
What way is this? Could the way maybe be changed? Judging by another big software title I suspect not (so easily):
World of Warcraft suffers from the very same problems. My 170 LUA addons scripts are all loaded by one main thread and then run by the WOW main thread.
The latter (run) can lead to a script causing massive FPS drops down to a complete halt. There are lots of extra threads running alongside the main thread, though, putting all kinds of extra load on other cores (mainly GPU/output related stuff I suspect, have to switch back from DX12 to DX11 to check).
The former (load) is solved differently compared to FG. What WOW does is that after each (or maybe a bunch) of scripts are loaded it updates the UI to fill the progress bar a bit and respond to the OS. It's jumpy, there are massive fps drops in between (from 1200 to 0), but it keeps the process responding and gives the user a sense of progress.