RE: Linux thread limit question

"Howell, David P" <[email protected]> Fri, 6 Sep 2002 11:41:36 -0700
Newsgroups gmane.linux.ngpt.user
Message-ID <[email protected]>
FWIW, I just tried the test case, looks a lot like 'test_str02 -l' in the
ngpt 
distribution. With ngpt-2.0.2rc1 I saw it make 10000 threads and then stop.
We
go a lot higher with 'test_str02 -l', up to 29K threads using defaults, 89K
if
we change the default thread stack size to be 16K by using the shell
variable DEFAULTTHREADSTACKSIZE.

For Linuxthreads the stock (unmodified library) supports 1023 threads, due
to 
the hard coded size for __pthread_handles in the library. I've seen it make 
this many threads with a 'test_str02 -l'. It can be recompiled to go higher.
I don't know where Linuxthreads binaries compiled for more threads are
available,
I'd check the glibc website to download the stock version and up the
threads, 
that was where I got the source code from.

Dave Howell

-----Original Message-----
From: Darrell Michaud [mailto:[email protected]]
Sent: Friday, September 06, 2002 1:54 PM
To: [email protected]
Subject: [pthreads-users] Linux thread limit question


Hello,

I know this is a probably a FAQ, but all of the information I can find
at http://linuxperf.nl.linux.org/ and other common linux kernel tuning
sites only talk about 2.0 and 2.2 Linux kernels, with hardly anything
said about 2.4

My problem is that I compiled and ran the "thread-limit.c" program from
this site http://people.redhat.com/alikins/tuning_utils/thread-limit.c
and it only appears to create 255 threads. Here's a sample output:

  Creating threads ...
  Address of c = 1058258 KB
  Address of c = 1066450 KB
  Address of c = 1074642 KB
  Address of c = 1082834 KB
  Address of c = 1091026 KB
  Address of c = 1099218 KB
  Address of c = 1107410 KB
  Address of c = 1115602 KB
  Address of c = 1123794 KB
  Address of c = 1131986 KB
  100 threads so far ...
  200 threads so far ...
  Failed with return code 11 creating thread 256.

I tried compiling this test on both stock RedHat73 (2.4.18-10 kernel)
and Redhat72 (2.4.9-34 kernel) with the same results.

- cat /proc/sys/kernel/threads-max returns "8191"
- ulimit returns 'unlimited' or similarly high numbers in all
catagories.
- /etc/sysctl.conf does not have any restrictions
- /etc/security/limits.conf does not have any restrictions 
- I tried running the test both as root and as an unpriviledged user.
- The sites that host the thread-limits.c file only has information
pertaining to the 2.2 series of kernels.

Assuming that I don't want to jump to the 2.4.19 kernel and play with
NGPT, what can I do to create more than 256 pthreads per process? Does
anyone know what specifically needs to be changed in the kernel, and
what specifically needs to be changed in glibc?  

Better yet, is there a trustworthy site to download prepatched binaries
to enable more threads?

Thanks in advance

_______________________________________________
pthreads-users mailing list
[email protected]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/pthreads-users