How is asynchronous callback implemented?
How do all the languages implements asynchronous callbacks? For example in C++, one need to have a "monitor thread" to start a std::async . If it is started in main thread, it has to wait for the callback. std::thread t{[]{std::async(callback_function).get();}}.detach(); v.s. std::async(callback_function).get(); //Main thread will have to wait What about asynchronous callbacks in JavaScript? In JS callbacks are massively used... How does V8 implement them? Does V8 create a lot of threads to listen on them and execute callback when it gets message? Or does it use one thread to listen on all the