4 ms·
Yes it is a lightweight thread or “green” thread. Coroutines that are scheduled by the languages runtime across a pool of multiple OS threads and are implemente
by jeremyjh 4y ago
Yes it is a lightweight thread or “green” thread. Coroutines that are scheduled by the languages runtime across a pool of multiple OS threads and are implemented using an event loop that resumes a coroutine whenever the IO it was blocked on is available, sort of like if in Node all the async/await keywords were implemented for you automatically on every IO OP.
Some languages (Erlang, Go, Haskell) have green threads with preemptive scheduling on CPU loops (though Go only preempts at function boundaries IIRC) but Pony does not, actors have to cooperate.
- Matthias247 4y ago> though Go only preempts at function boundaries IIRC I think this was improved with more recent Go versions and now it is really preemptive