Python with many threads
talon at lpthe.jussieu.fr
Tue Dec 16 14:29:46 UTC 2008
> Exception in thread 30:
> Traceback (most recent call last):
> File "/usr/local/lib/python2.5/threading.py", line 486, in
> The number of errors increases rapidly with even bigger number of
> Is there any way I can increase the maximum number of Python threads?
Nothing limits the number of concurrent threads. Personnally i have
checked i can run Grub Next Generation Python Client with 600 threads
without any problem.
niobe% uname -a
FreeBSD niobe.lpthe.jussieu.fr 7.0-STABLE FreeBSD 7.0-STABLE #0: Tue Jul
22 10:31:01 CEST 2008
Python 2.5.2 (r252:60911, Jul 5 2008, 13:44:44)
Recall that python threads are just native threads, but these threads
are protected from trashing the python state by a single lock, the GIL,
which is released when you do IO. This allows to effectively thread IO,
but not python computation. The FreeBSD thread library has no particular
limitations, you can run hundreds or thousands of threads without much
problem, for example under Java.
More information about the freebsd-questions