Re: OT: Limit on maximum # of threads in Linux?
holger rauch wrote:
> Hi!
>
> I tried the following test program with various 2.4.x und 2.2.x kernels and
> noticed that it doesn't *seem* to be possible to create more than 1021
> threads. I changed "ulimit -u" from within bash before running the thread
> test program, I modified a setting in the /proc filesystem:
>
> /proc/sys/kernel/threads-max
>
> (but that limit is 12287 with a 2.4.21 kernel, so it should be high enough
> anyway),
>
> but all I got was:
>
> [...]
> Thread #1019: Thread started...thread done
> Thread #1020: Thread started...thread done
> Thread #1021: Thread started...thread done
> Thread #1022: *** Unable to create thread #1021 ***
>
My answer is out of topic too:
The current LinuxThreads doesn't handle more than (about) 1023 attached
threads running. (There always a control thread)
Use pthread_detach(), but you won't be able to pthread_join() them after.
--
Yann Droneaud <yann.droneaud@mbda.fr>
MBDA France Missile Systems -- http://www.mbda.net/
Etudes Logiciels Sol, Bourges
Bureau +33 (0) 2 48 55 71 58 | Portable +33 (0) 6 88 40 82 43
Reply to: