News for hackers. Stuff that matters.
Re:Scipio: A Thread-per-Core Crate for Rust and Linux by Joker_vD on Tuesday November 03, 2020 @11:40AM (#24981233)
No, it's not necessary to perform a CPS transformation. After all, the OS manages to pre-emptively schedule any non-cooperating processes, right?

So, leaving aside the problem of interacting with the OS for I/O, you can do interleaved CPU-bound in a single thread, by instrumenting your code with basically an instruction counter. When it grows a bit too large, stop, reset it, and switch to another task. Erlang does this, although being a functional language, it counts only function calls (no other way to make a loop than to (tail-)call itself). No CPS needed.

Re:Scipio: A Thread-per-Core Crate for Rust and Linux by gpderetta on Tuesday November 03, 2020 @12:03PM (#24981468)
Yes of course, a stack per thread is always an option.