Python threading, and processes
Diez B. Roggisch
deets at nospam.web.de
Wed Feb 8 08:24:38 EST 2006
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.
And the limitation of allowed threads per process and/or system is also a
OS-dependend thing.
"""
Under Linux, threads are counted as processes, so any limits to the number
of processes also applies to threads. In a heavily threaded app like a
threaded TCP engine, or a java server, you can quickly run out of threads.
"""
from
http://people.redhat.com/alikins/system_tuning.html#threads
Diez
More information about the Python-list
mailing list