multiprocessing vs thread performance

Christian Heimes lists at cheimes.de
Mon Dec 29 16:17:37 CET 2008


mk wrote:
> Am I doing smth wrong in code below? Or do I have to use
> multiprocessing.Pool to get any decent results?

You have missed an important point. A well designed application does
neither create so many threads nor processes. The creation of a thread
or forking of a process is an expensive operation. You should use a pool
of threads or processes.

The limiting factor is not the creation time but the communication and
synchronization overhead between multiple threads or processes.

Christian




More information about the Python-list mailing list