Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Differing terminologies for Synchronous Code and Async Code for Lua vs. other languages?

Asked by 3 years ago
Edited 3 years ago

Here's the thread for reference: https://devforum.roblox.com/t/promises-and-why-you-should-use-them/350825

Evaera says that synchronous operations have all the required data needed to fulfill a return value at the time the operation began. She also says that asynchronous operations do not have all the required data needed to fulfill a return value due to either waiting for user input or a network request for data.

But then, I go on StackOverFlow and I searched up the difference between synchronous code and asynchronous code (over here:https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean#:~:text=Synchronous%20basically%20means%20that%20you,move%20on%20to%20next%20one and it says that in a program that executes synchronously, you must wait for each task to finish before moving onto the next task, whereas a program that executes asynchronously can execute multiple tasks at once.

That was the highest rated answer on StackOverFlow however there was another highly rated answer that has a different definition for them too. Another person said that synchronous tasks are tasks that must be executed in sequential order because one task may rely on the data from another task, while asynchronous tasks are independent tasks that do not require data from other tasks and as such can be ran in a different thread if desired (or sometimes just single threaded) - So this guy implies that sync/async technically doesn't have anything to do with threading and async code can very well be ran in a single thread if so desired.

Who is right? Or all they all right, and Evaera's definition of async/sync tasks is right in the context of RBLXLua?

LINKS NOT WORKING FOR SOME REASON

Answer this question