3 ms·
If you have green threads, and you wrap calls that may block such that they redirect to your own scheduler, you can simply save the green thread context, initia
by barrkel 17y ago
If you have green threads, and you wrap calls that may block such that they redirect to your own scheduler, you can simply save the green thread context, initiate an async call, and when the async call completes you can restore the thread and reschedule it.
Your scheduler may be as simple as a bunch of threads using work-stealing queues to grab jobs; a job is scheduled by adding it to a queue.