Async.js - Is parallel really parallel?

前端 未结 5 1904
逝去的感伤
逝去的感伤 2020-12-10 03:26

As I have understood so far: Javascript is single threaded. If you defer the execution of some procedure, you just schedule it (queue it) to be run next time the thread is f

5条回答
  •  佛祖请我去吃肉
    2020-12-10 03:58

    The functions are not executed simultaneously, but when the first function handed off to an asynchronous task (e.g. setTimeout, network, ...), the second will start, even if the first function hasn't called the provided callback.

    As for the number of parallel tasks: That depends on what you pick.

提交回复
热议问题