When should parallel LUA be used?

From what I’ve read from here, parallel Lua is just multi-threaded behaviour; the ability to execute code belonging to one program simultaneously, with the added twist from ROBLOX that the programs have to belong to different actors.

In the past, when developers have wanted to change the properties of instances asynchronously, they’ve had to use coroutines, which are in practice, callable sub-programs allowing for two segments of code (in Luau, two functions) to run in parallel.

By introducing this in the way ROBLOX has stated in the linked post, they allow developers to streamline this problem without having to appreciate the entire scope of coroutines and asynchronicity. Whilst I prefer lobbing everything in a script / ModuleScript and editing one portion of code, this method allows developers to place (if needed, where code isn’t repeatable) scripts within models like NPCs and have functions within those scripts call at the same time.

I can imagine this update will be useful for games simulating hordes of zombies, where each individual zombie has an AI. Instead of iterating through every zombie and updating their pathfinding, hordes can now change their behaviour quickly, proportionate to the number of cores being allocated to their associated VM.

Hope this clarifies a little. As mentioned in the post, this update is still in beta - please forgive (and correct) me for any assumptions / misunderstandings I have made.

7 Likes