|
|
|
|
|
by pavlov
1078 days ago
|
|
But the difference is that wait_all() is blocking the thread, right? Or does it keep running the event loop while it's waiting, so callbacks for other events can be processed on the same thread? If it does the latter, the stack will keep growing with each nested wait call: main -> runEventLoop -> someCallback -> wait_all -> runEventLoop -> anotherCallback -> wait_all -> ... The async/await transformation to a state machine avoids this problem. |
|
(the operating system's thread scheduler is basically the equivalent to the JS "event loop").