multiprocessing vs thread performance

Arash Arfaee erexsha at gmail.com
Thu Jan 8 01:55:51 CET 2009


Hi All ,

Does anybody know any tutorial for python 2.6 multiprocessing? Or bunch of
good example for it? I am trying to break a loop to run it over multiple
core in a system. And I need to return an integer value as the result of the
process an accumulate all of them. the examples that I found there is no
return for the process.

Thanks,
-Arash

On Mon, Jan 5, 2009 at 7:24 PM, Gabriel Genellina <gagsl-py2 at yahoo.com.ar>wrote:

> En Sat, 03 Jan 2009 11:31:12 -0200, Nick Craig-Wood <nick at craig-wood.com>
> escribió:
>
>> mk <mrkafk at gmail.com> wrote:
>>
>
>   The results I got are very different from the benchmark quoted in PEP
>>>  371. On twin Xeon machine the threaded version executed in 5.54 secs,
>>>  while multiprocessing version took over 222 secs to complete!
>>>
>>>  Am I doing smth wrong in code below?
>>>
>>
>> Yes!
>>
>> The problem with your code is that you never start more than one
>> process at once in the multiprocessing example.  Just check ps when it
>> is running and you will see.
>>
>
> Oh, very good analysis! Those results were worriying me a little.
>
> --
> Gabriel Genellina
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090107/fbf31ea9/attachment.html>


More information about the Python-list mailing list