Coroutine

Co-ordinate the thread to determine which one execute first using event loop.

For example:

Pasted image 20231012215403.png

As a result, we can achieve concurrency with only single thread.

An improved version is Goroutine which used multiple waiters