Python threading, and processes

Robin Haswell rob at digital-crocus.com
Wed Feb 8 08:50:16 EST 2006


On Wed, 08 Feb 2006 14:24:38 +0100, Diez B. Roggisch wrote:

> Robin Haswell wrote:
> 
>> Hey there
>> 
>> I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and
>> Debian machines, and I've noticed that if I open a lot of threads (say,
>> 50), I get lots of python processes with individual PIDs, which consume a
>> disproportionate amount of CPU. Does this mean that Python is using the
>> dummy_thread module by accident? And is there a realistic limitation to
>> the number of threads I can do?
> 
> Both system-depend. The way threads are shwon depends on the systenm. And a
> thread that runs, runs  - so it consumes cpu-cycles. Try calling
> time.sleep() to see how the consumption decreases.

Cheers for that info. The thread's main tasks are getting webpages
(spidering), the actual amount of processing done in each thread is
minimal - that's why I'm confused by the CPU usage.

Cheers

-Rob

> 
> Diez




More information about the Python-list mailing list