Re:Cooperative Threading
by kccqzy on Wednesday November 13, 2019 @02:16AM
(#21521771)
Haskell has something similar: by default it uses SIGVTALRM for preemption but you can configure the runtime to instead hook the allocator, and stop the thread once it has allocated enough. (Threads have to be stopped during allocation for GC anyways so the functionality is already there.) The only difficulty is threads that do not allocate at all, but that doesn't happen in real-world Haskell code outside special micro benchmarks.
[ Parent
| on HN ]
There are no comments on this comment yet.