logoalt Hacker News

nxobject • yesterday at 1:44 PM • 2 replies • view on HN

I’m curious to see whether “no pre-emption” will hold as applications scale up. Given the aggressive enforcement of time-slicing, I’d have trouble writing, say, tasks that lends itself to a recursive call structure yet yields in a predictable amount of time.

(I wrote a parser-compiler for the classic Macintosh OS, which notoriously had cooperative multitasking… by the end I ended up simulating pre-emption by sprinkling calls to a routine that did “check timer, yield to OS if needed”.)


Replies

cowlevel • yesterday at 7:49 PM

Perhaps they could add a special kind of compute-bound actor that is preemptible but can't receive messages asynchronously, other than termination.

dapperdrake • yesterday at 4:02 PM

Obviously, it won’t hold up. That is why most production systems converge on non-cooperative externally pre-empted multi-processing and multi-threading.