Is Roblox Studio single-threaded?

I know that Lua is single-threaded but like, how is Roblox single-threaded if it is?
I mean, in games where you need to run like one localscript with a connected event and then like multiple other scripts like maybe server scripts (scripts) with connected events too, how is that not parallel? Is it really all concurrent?

1 Like

Each script in a game gets it’s own thread. You can cheat a multi-threaded script by using coroutines.

Thanks @Xeptix for giving a more in depth reasoning.

3 Likes

It is multi-threaded, and each script runs independent from the next. You can also new open threads via scripts.

Lua is ran and controlled by C in this case, C holds all the events and such in its memory, thus any script can access and use it, despite each script being separately threaded from the rest. They can still share information without any single thread controlling it because lua is just one of many layers in the system, the parent level, C is what controls that. That is also why we have roblox APIs in game that call C functions, like the marketplace stuff.

3 Likes