3 ms·
I always wonder when I come across a text like this what a lightweight process is. Is it different from just a thread? Or is it a type of lightweight/virtual th
by 0xTadash1 4y ago
I always wonder when I come across a text like this what a lightweight process is. Is it different from just a thread? Or is it a type of lightweight/virtual thread?
- aidenn0 4y agoThere are multiple definitions of LWPs. I think the way it is being used here is a user-scheduled thread. In the old Unix days it meant "kernel thread"
- jeremyjh 4y agoYes 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