recently, I have been studying event loop
. I have read a lot of articles written by my predecessors, who said that when the main thread executes an asynchronous task, it initiates a call, then suspends it, and when it has a return value, it is placed in the task queue to wait for the main thread to call the callback function to get the return value.
but I don"t understand how to hang it. When the main thread performs another task when it is suspended, what is the suspended asynchronous task doing? Where?
such as ajax
request, don"t you need a thread to run it when receiving data from the server?
is there anything my brother knows? Solve.