News for hackers. Stuff that matters.
Re:Memory efficiency of parallel IO operations in Python by simias on Tuesday March 13, 2018 @08:51AM (#16575680)
Thread swapping has a non-negligible cost but I'm not sure what you mean by swapping the stack. Aren't they just swapping stack pointers? That's how I'd naively implement it.

You still have to bank a whole bunch of registers and there might be detrimental side effects but I can't imagine why the stack would get in the way. Process swapping is obviously much worse since you change the process ID and the virtual memory mapping but even then I don't see why you'd ever copy the stack.

Re:Memory efficiency of parallel IO operations in Python by lmm on Tuesday March 13, 2018 @08:54AM (#16575701)
Yes, you're right. The size of the stack is relevant to how much memory each switched-out task takes up, but not directly to how costly the switching process is.