threading

Marko Rauhamaa marko at pacujo.net
Mon Apr 7 09:49:44 EDT 2014


Roy Smith <roy at panix.com>:

> The idea that we should continue to use threading just because Windows
> makes process creation hideously expensive compared to thread creation
> doesn't impress me as an argument in favor of threading. It impresses
> me as an argument in favor of ditching Windows.

There are many reasons to start processes or threads. One of them is
performance (you have more than one CPU core). When performance is the
objective, my rough guidelines would be:

 * Start your processes during initialization.

 * Start about twice as many processes as there are CPUs.

IOW, the processes are there to exercise the CPUs and should not
represent individual connections or other dynamic entities.

I don't program for Windows, but that's the approach I would take under
linux as well.


Marko



More information about the Python-list mailing list