maximum number of threads

Felipe Almeida Lessa felipe.lessa at gmail.com
Wed Jan 10 09:11:59 EST 2007


On 1/10/07, Laurent Pointal <laurent.pointal at limsi.fr> 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.

---
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
max nice                        (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) unlimited
max rt priority                 (-r) unlimited
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
---

Well, unlimited number user processes. But:

---
$ python test.py
50
100
150
200
250
300
350
Exception raised: can't start new thread

Biggest number of threads: 382
---

The test.py script is attached.

-- 
Felipe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 427 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20070110/f6490060/attachment.py>


More information about the Python-list mailing list