469,916 Members | 1,853 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,916 developers. It's quick & easy.

How many threads are too many?

rbt
This may be a stupid question, but here goes:

When designing a threaded application, is there a pratical limit on the
number of threads that one should use or is there a way to set it up so
that the OS handles the number of threads automatically? I am developing
on 32-bit x86 Intel systems with python 2.4.1. The OS will be Linux and
Windows.

I have an older app that used to work fine (254 threads) on early 2.3
Pythons, but now, I get this error with 2.4.1 and 2.3.5:

Traceback (most recent call last):
File "net_queue_and_threads.py", line 124, in ?
thread.start()
File "/usr/lib/python2.3/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

Jul 19 '05 #1
1 2725
In article <d7**********@solaris.cc.vt.edu>,
rbt <rb*@athop1.ath.vt.edu> wrote:

When designing a threaded application, is there a pratical limit on the
number of threads that one should use or is there a way to set it up so
that the OS handles the number of threads automatically? I am developing
on 32-bit x86 Intel systems with python 2.4.1. The OS will be Linux and
Windows.
The practical limit is somewhere between five and a hundred threads,
depending on what you're doing. The more I/O you're doing, the more
greater numbers of threads will benefit you.
I have an older app that used to work fine (254 threads) on early 2.3
Pythons, but now, I get this error with 2.4.1 and 2.3.5:

Traceback (most recent call last):
File "net_queue_and_threads.py", line 124, in ?
thread.start()
File "/usr/lib/python2.3/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread


That's rather odd. Which OS is this? Did you build Python yourself or
did you download it?
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Przemysław Różycki | last post: by
34 posts views Thread by Kovan Akrei | last post: by
9 posts views Thread by Eric Sabine | last post: by
7 posts views Thread by mircu | last post: by
6 posts views Thread by RahimAsif | last post: by
10 posts views Thread by cj | last post: by
7 posts views Thread by Michael | last post: by
6 posts views Thread by Alexander Walker | last post: by
9 posts views Thread by jdlists | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.