Hacker Newsnew | past | comments | ask | show | jobs | submit | 0xTadash1's commentslogin

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?


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.


> though Go only preempts at function boundaries IIRC

I think this was improved with more recent Go versions and now it is really preemptive


There 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"


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: