Coroutines is something to simulate collaborative multithreading (.NET is not supported unless we consider the async / await pattern as a coroutine pattern).
Asynchronous programming imitates multithreading (at least partially ... Several read / write operations are performed at the same time) ... Both options are possible solutions that hide the "threading" part.
To develop asynchronous programming ... One could create a whole web server capable of simultaneously responding to hundreds of requests based on a single thread + asynchronous development. Each read from disk will be performed asynchronously. Each response to connecting clients will be performed asynchronously, etc.
To give a name, from what I understand, node.js is a single-threaded web server entirely based on asynchronous programming (technically called non-blocking I / O) ... See for example fooobar.com/questions/25352/ .. .
To what I wrote, I add that there are some languages โโthat implement the so-called Green Themes . Green threads are shared threads that do not use the OS scheduler. Their code is so executed in one thread (at least from their point of view). It seems that Go, haskell, old Ruby, various versions of Smalltalk use / use green threads).
source share