Python and JavaScript don’t do CPU threads (well, Python can do threads, but that’s not relevant here, because Python’s thread stuff isn’t inherently await-able). So they fake threading with “event loops”.
C++ is a low-level language that knows what CPU threads are and expects to make use of them. As such, when you co_await
on some expression, you are typically awaiting on a process that is (potentially) happening in another thread.
You certainly can fake threading with an event loop, and create some awaitable type that uses event loop processing. But that’s not typically what C++ programmers do with asynchronous processing.
In C++ coroutines, the way the resumption of execution of a coroutine works depends entirely on the awaitable type you’re using. It governs the scheduling of the function’s resumption. Most awaitables in C++ will use some form of CPU threading (the most common method being to invoke the coroutine on the thread performing the async process it is waiting on). Others may have some kind of event loop or whatever. But the point is that this is a function of the thing which produces the value you’re waiting on, not the coroutine itself.