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

The Erlang runtime uses non-blocking IO calls to the kernel but exposes blocking functions on top of this. Is such a function really blocking? It depends on what level you're looking at; it's blocking at Erlang level but non-blocking at kernel level. I think this is the source of the confusion. You are of course correct in saying "If you have a blocking call you still have to block an OS thread somewhere." if you're looking at kernel level, but not Erlang level (since it can translate blocking to non-blocking).

> If you have non-blocking IO then it seems like you could easily implement an M:N threading model as a library without making it awkward to interact with.

Yes, but your language/system has to have some mechanism to manage control flow. Examples: F# does what you ask for via asynchronous workflows. Ruby via fibers/EM-Synchrony. Java via a bytecode weaver like Kilim.



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

Search: