Async.js - Is parallel really parallel?

前端 未结 5 1907
逝去的感伤
逝去的感伤 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 04:25

    Async.Parallel is well documented here: https://github.com/caolan/async#parallel

    Async.Parallel is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.

提交回复
热议问题