While Lua itself isn't multi-threaded, it has 'coroutines', and using them it should be possible to emulate lilypond-book behaviour, I think: If a new lyluatex option parallel=<n> (or whatever) is set, lualatex won't wait for the result of LilyPond for a lilypond environment but simply spawns a LilyPond process up to n times. This would enormously speed up everything, at the cost of running lualatex at least twice.
While Lua itself isn't multi-threaded, it has 'coroutines', and using them it should be possible to emulate
lilypond-bookbehaviour, I think: If a new lyluatex optionparallel=<n>(or whatever) is set,lualatexwon't wait for the result of LilyPond for alilypondenvironment but simply spawns a LilyPond process up to n times. This would enormously speed up everything, at the cost of running lualatex at least twice.