Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, these are true lightweight threads (implemented on top of an OS-thread pool, just as they are in Erlang and, I suppose, Haskell). You can have hundreds of thousands or even millions of these on a single machine. They can block for IO or for any other kind of synchronization (message passing etc.), just like regular threads.


whenever i hear "lightweight threads" my PTSD from experience with Java "green threads" comes back. Of course, my rational mind understands that many years have passed and things may in other runtimes be implemented differently and there are many benefits vs. native, yet ...


This has little, if any, to do with that. These lightweight threads are implemented pretty much exactly as they're implemented in Erlang or Go.


Are they preemptive?


Absolutely. Currently fibers (lightweight threads) may only be preempted when performing a blocking operation (IO or waiting on some synchronization mechanism). We will implement time-share based preemption if we see a need for that.




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

Search: