#What does Parallel Luau mean?

14 messages · Page 1 of 1 (latest)

broken fern
hushed zephyr
#

sure

slate sphinx
#

For example

#

Normal Lua runs code line by line

#

And waits for the previous line to finish

#

Parallel Lua just means running separate "Threads" at the same time

#

You can think of threads like independent code pieces

#

For example, every script is it's own thread. This means that all scripts run at the same time, but inside the scripts code is executed in serial( line by line, waiting for last line to finish)

#

The simplest example of parallel Luau would be something like this

#
task.spawn(function() -- create a new thread for the function to run in
T
task.wait(3)
print("parallel")
end)
print("serial") -- will print immediately without waiting for the above function to run
slate sphinx
broken fern
#

Ohh

#

Thx!! I understanded!!!