[Mono-list] Threads max out at 512?!?

Dick Porter dick@ximian.com
29 Oct 2002 10:04:29 +0000


On Tue, 2002-10-29 at 02:37, Erik C wrote:
> hey all just a warning...I'm a total newbie to
> C#/mono/threads. I'm trying to write this a stupid
> port scanner (it is very badly written BTW) and mono
> allways dies when I try to make any more than 512
> threads...is this normal, a mono issue, or a platform
> issue?

It's a mono issue.  There is a limit on the number of threads you can
have in a process on linux (its 1024 i think.)  The problem you're
seeing though is that it's running out of handle slots.  We used to get
up to a thousand or so threads before this happened, so I don't know why
it's lower now.

It's possible to increase the number of handle slots available (and I'm
currently thinking of making it increase dynamically) but you will still
run into the pthreads limit.

- Dick