6 ms·
One niche case where you need assembly is if you write a green threads library. At the yield points, you need to save all necessary registers of the current thr
by adwn 6y ago
One niche case where you need assembly is if you write a green threads library. At the yield points, you need to save all necessary registers of the current thread, and restore the registers of the thread you're switching to. There's no way you can do this without assembly, because you a) you need to control exactly which machine instructions are emitted in which order, and b) you need to read and write actual registers, not variables or memory locations.