How many threads can I create ???

Tim Roberts timr at probo.com
Wed Dec 5 08:46:05 CET 2001


Bartosz Zembrzuski <Bartosz.Zembrzuski at softax.com.pl> wrote:
>
>I've got problem with creating large number of threads on Linux.
>...
>86th thread gives me an error:
>...
>thread.error: can't start new thread
>
>I've no idea what's going on. Under Windows I've created over 2000
>python threads until error occures. 
>Similar program written in C (using pthreads) lets me create over 300
>threads (on the same linux machine)
>
>Any suggestions are welcome :)))

OK, here's a suggestion: don't do that.

The only use for your test is to establish the limits.  Now you know the
limit: 85.  However, that fact is not particularly useful.  It is
counterproductive to launch an application with a hundred threads.  You
will simply waste CPU time thrashing in the scheduler.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list