4 ms·
Haskell's runtime makes for cheaper threads than Erlang. Possibly cheaper than Go's, too.
by Peaker 14y ago
Haskell's runtime makes for cheaper threads than Erlang. Possibly cheaper than Go's, too.
- rektide 14y agoAre they also in Haskell as in Erlang pre-emptable by the runtime? There's certainly some cost in this design decision, more context that has to be swapped in and out and more state kept, but it's important capability to allow blind design & use- think Node, where everyone has to keep re-iterating how important it is to keep yielding to the event loop, to not do a lot of CPU work in a handler: irrelevant in Erlang world- in spite of the threading model not being OS threads, Erlang is happy to drop your lightweight thread on the fly when it sees fit.
- rdtsc 14y ago> irrelevant in Erlang world Exactly. That is a subtle distinction but for cases where responsiveness and low latency is important that is key. Another thing Erlang has is isolation of process heaps. If one process crashes, it won't affect others. No shared data structures between processes. It all goes to fault tolerance but also a major win for a completely concurrent garbage collection.
- masklinn 14y ago> If one process crashes, it won't affect others. Unless they're linking or monitoring one another, an other important property of tolerant and distributed system.
- burntsushi 14y ago> Are they also in Haskell as in Erlang pre-emptable by the runtime? Yes. [1] [1] - http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent.html#g:14 http://www.haskell.org/ghc/docs/latest/html/libraries/base/C...
- masklinn 14y ago> Haskell's runtime makes for cheaper threads than Erlang. Possibly cheaper than Go's, too. What's your measure for expenses? Because if it's size in memory goroutines seem more expensive than erlang processes: http://en.munknex.net/2011/12/golang-goroutines-performance.html http://en.munknex.net/2011/12/golang-goroutines-performance.... indicates goroutines were measured at ~4k; the default start size for an erlang process is ~310 words, or ~2k on a 64b machine.
- Peaker 14y ago1kb in ghc, iirc.