[Python-ideas] multiprocessing and physical CPU cores count

Andrew Barnert abarnert at yahoo.com
Fri Sep 13 04:37:09 CEST 2013

On Sep 12, 2013, at 19:17, Westley Martínez <anikom15 at gmail.com> wrote:

>> From: Python-ideas [mailto:python-ideas-
>> bounces+anikom15=gmail.com at python.org] On Behalf Of Antoine Pitrou
>> Sent: Thursday, September 12, 2013 2:16 PM
>> To: python-ideas at python.org
>> Subject: Re: [Python-ideas] multiprocessing and physical CPU cores
>> count
>> I'm not sure what the point would be.  From the point of the view of
> an
>> application programmer, the CPU topology is an almost esoteric detail.
>> This would be appropriate for a third-party "system information"
>> package, IMO (with memory speed, number of PCIe channels, cache
>> associativity, etc.).
>> Regards
>> Antoine.
> Isn't the whole point of a high-level language to be able to not
> have to know about the hardware?

Most programmers won't care; they'll just use the default value for multiprocessing.Pool. 

But the implementation of multiprocessing, or any similar third-party module like pp, needs that information, so it can pick a good default value so the programmers don't have to.

Also, very occasionally, you need to build a pool of processes manually. So if the module has the info, it might as well expose it.

More information about the Python-ideas mailing list