LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-17-2004, 03:04 PM   #1
meeble
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13

Rep: Reputation: 0
Question 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 ?
 
Old 03-17-2004, 03:16 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 03-17-2004, 08:05 PM   #3
meeble
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13

Original Poster
Rep: Reputation: 0
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
 
Old 03-17-2004, 09:09 PM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 03-17-2004, 10:53 PM   #5
meeble
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13

Original Poster
Rep: Reputation: 0
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...
 
Old 03-18-2004, 06:30 AM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 03-18-2004, 08:28 PM   #7
meeble
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat / slackware
Posts: 13

Original Poster
Rep: Reputation: 0
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java threads listed using kill -3 does not contain all threads found using ps -auxww coneheed Programming 2 11-14-2005 08:57 AM
Threads - Max Limit socratesinus Linux - Software 5 04-20-2005 03:43 PM
what's the kernel's main() function? LordOfer Linux - General 1 04-06-2005 03:02 PM
Kernel's CryptoAPI irfanhab Programming 1 09-17-2004 07:35 PM
Java Threads vs Native Threads rjmendez Programming 0 08-16-2004 05:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration