How many threads are too many?

Discussion in 'Python' started by rbt, Jun 5, 2005.

  1. rbt

    rbt Guest

    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
     
    rbt, Jun 5, 2005
    #1
    1. Advertising

  2. rbt

    Aahz Guest

    In article <d7vcki$5e7$>,
    rbt <> 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 () <*> http://www.pythoncraft.com/

    f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
     
    Aahz, Jun 12, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. peelman

    How many threads is too many?

    peelman, Jan 13, 2005, in forum: Java
    Replies:
    12
    Views:
    857
    Esmond Pitt
    Jan 15, 2005
  2. Rhino
    Replies:
    33
    Views:
    1,334
    Oliver Wong
    Dec 22, 2005
  3. bernd
    Replies:
    10
    Views:
    2,280
    Gordon Beaton
    Aug 6, 2008
  4. Too many threads

    , Sep 16, 2010, in forum: Python
    Replies:
    2
    Views:
    474
    Ned Deily
    Sep 17, 2010
  5. Dag Sunde
    Replies:
    4
    Views:
    373
Loading...

Share This Page