3 ms·
There is some background in the first blog post on the topic: http://250bpm.com/blog:69 http://250bpm.com/blog:69 I guess it made sense from performance point
by chubot 11y ago
There is some background in the first blog post on the topic:
http://250bpm.com/blog:69 http://250bpm.com/blog:69
I guess it made sense from performance point of view back then. All the stuff that makes process switching slow today haven't yet existed. Machines had single processor, there was no virtual addressing or memory caches. In such an environment process switching was closer to what we call green threads today.
So he is referring to hardware changes that made processes relatively more expensive than they used to be. I would think that the old machines still incurred some hit from a state change in the MMU. But I am far from an expert in that area.
Also, this statement seems suspect, because multiple cores properly used can make processes CHEAPER. Because there will be ZERO process-switching cost -- you have parallel processes. This is why I advocate an architecture based on heterogeneous threads or processes and message passing -- in contrast to process-per-connection, which implies homogeneous processes and little message passing.
The Go designers also advocate heterogeneous goroutines, toward the goal of program modularity rather than performance.
If you have heterogeneous threads/processes pinned to cores, that's pretty much the most efficient way of using your hardware. But writing this type of code is not so obvious without some planning, foresight, and working around language quirks.