On Wed, 10 Jan 2007 12:11:59 -0200, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >On 1/10/07, Laurent Pointal <[EMAIL PROTECTED]> wrote: >>This is a system configurable limit (up to a maximum). >> >>See ulimit man pages. >> >>test >> >> ulimit -a >> >>to see what are the current limits, and try with >> >> ulimit -u 2000 >> >>to modify the maximum number of user process (AFAIK each thread use a >>process entry on Linux) > >I don't think it's only this.
Indeed you are correct. The actual limit you are hitting is the size of your address space. Each thread is allocated 8MB of stack. 382 threads consumes about 3GB of address space. Even though most of this memory isn't actually allocated, the address space is still used up. So, when you try to create the 383rd thread, the kernel can't find anyplace to put its stack. So you can't create it. Try reducing your stack size or reducing the number of threads you create. There's really actually almost no good reason to have this many threads, even though it's possible. [EMAIL PROTECTED]:~$ python Desktop/test.py 50 100 150 200 250 300 350 Exception raised: can't start new thread Biggest number of threads: 382 [EMAIL PROTECTED]:~$ ulimit -Ss 4096 [EMAIL PROTECTED]:~$ python Desktop/test.py 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 Exception raised: can't start new thread Biggest number of threads: 764 [EMAIL PROTECTED]:~$ Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list