3 ms·
Haskell definitely makes it easier. You can use preemptive green threads with almost all the ease of cooperatively multitasked code because of the prevalence of
by Peaker 14y ago
Haskell definitely makes it easier.
You can use preemptive green threads with almost all the ease of cooperatively multitasked code because of the prevalence of immutability.
You get the performance benefits of non-blocking code.
The simplicity benefits of blocking code.
And (almost) none of the threading hell you get in imperative languages.
- fzzzy 14y agoAre they really preemptive? How does the scheduler decide when to switch?
- Peaker 14y agoYeah, they are preemptive (though there had been a long-standing bug where threads that have no allocations don't get preempted, I believe it is fixed now). This is some documentation of the scheduler: http://blog.ezyang.com/2013/01/the-ghc-scheduler/ http://blog.ezyang.com/2013/01/the-ghc-scheduler/