Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-17-2004, 03:04 PM
|
#1
|
LQ Newbie
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13
Rep:
|
What is 2.6 Kernel's max concurrent threads?
Heya,
We've been struggling with ways to get more concurrent threads on our RedHat boxes for months now. Redhat defaults to 255 threads and then stops there. Slackware defaults to 1500 out of the box which is a lot better. Supposedly, with tweaking and recompiling glibc, you can attain up to 4096 or 8192 threads. All of our attempts at this failed! Then, someone told me that the 2.6 kernel uses a new threading model that doesn't rely on glibc. Does anyone know more about this?
How many concurrent threads can you achieve with Kernel 2.6 ?
|
|
|
03-17-2004, 03:16 PM
|
#2
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
Code:
/*
* This controls the default maximum pid allocated to a process
*/
#define PID_MAX_DEFAULT 0x8000
/*
* A maximum of 4 million PIDs should be enough for a while:
*/
#define PID_MAX_LIMIT (4*1024*1024)
I did find the above in threads.h from the 2.6.4 kernel source.
This would seam to show that 32768 is the max pid's for a process and that 4 million or so is the max for the machine.
Not knowing exactly how it is all glued together in the threading system I can't tell you if these actually mean what I think they might mean.
Last edited by jtshaw; 03-17-2004 at 03:20 PM.
|
|
|
03-17-2004, 08:05 PM
|
#3
|
LQ Newbie
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13
Original Poster
Rep:
|
Quote:
Originally posted by jtshaw
*snip*
I did find the above in threads.h from the 2.6.4 kernel source.
This would seam to show that 32768 is the max pid's for a process and that 4 million or so is the max for the machine.
Not knowing exactly how it is all glued together in the threading system I can't tell you if these actually mean what I think they might mean.
|
Thanks jtshaw,
that's promising... Has anyone run a thread testing app with the 2.6 kernel?
Or does anyone have any concrete info on how many concurrent threads are
possible with 2.6 ?
thanks,
meeble
|
|
|
03-17-2004, 09:09 PM
|
#4
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
hermm, I ran this bit of code
Code:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
int cnt_created_threads=0;
void* thrd(void *dmy){
cnt_created_threads++;
pthread_exit(NULL);
}
int main(int argc, char* argv[]){
int i=0;
int thread_handle=0;
pthread_t th_dummy;
for(i=0;i<100000;i++){
thread_handle=pthread_create(&th_dummy,NULL,&thrd,NULL);
printf("cnt_created_threads=%d,i=%d\n",cnt_created_threads,i);
}
return EXIT_SUCCESS;
}
On my 2.6.4 kernel machine and it only got up to 255.........
I'll see if I can change that number somehow.
EDIT:
And yes.. oddly enough, I compile/run it on my slackware server and it goes up to 1532
Last edited by jtshaw; 03-17-2004 at 09:15 PM.
|
|
|
03-17-2004, 10:53 PM
|
#5
|
LQ Newbie
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13
Original Poster
Rep:
|
Quote:
Originally posted by jtshaw
hermm, I ran this bit of code
On my 2.6.4 kernel machine and it only got up to 255.........
I'll see if I can change that number somehow.
EDIT:
And yes.. oddly enough, I compile/run it on my slackware server and it goes up to 1532
|
weird. so, the exact same 2.6.4 kernel on slackware gets 1532 threads where it only got 255 on RedHat? I wonder if glibc is compiled differently on slackware...
|
|
|
03-18-2004, 06:30 AM
|
#6
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
I e-mailed Patrick over at Slackware and asked him if he knew what caused that behavior. If I hear back from him I'll let you know.
|
|
|
03-18-2004, 08:28 PM
|
#7
|
LQ Newbie
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13
Original Poster
Rep:
|
Quote:
Originally posted by jtshaw
I e-mailed Patrick over at Slackware and asked him if he knew what caused that behavior. If I hear back from him I'll let you know.
|
thanks...
|
|
|
All times are GMT -5. The time now is 09:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|