using threads with for-loops
Mathias Waack
M.Waack at gmx.de
Tue Sep 28 16:30:20 EDT 2004
Peter Hansen wrote:
> Mathias Waack wrote:
>> Have you ever seen machines with more than one CPU?
>
> Why yes, I have! And have *you* seen an implementation
> of Python which will effectively use those multiple CPUs
> in code like that above which runs in a single process?
Ok, I've lost: I haven't seen such implementation and don't know much
about the thread-layer of Python.
>> The code above is perfectly suited for parallelization.
>
> Yes, it is. Once you take into account implementation
> issues (e.g. the GIL), would you still think so?
Depends. Which means: don't know. If I would start thinking about
creating threads to gain a speedup, I would even think about
switching to another programming language.
Mathias
More information about the Python-list
mailing list