LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2006, 08:01 AM   #1
Agnello
LQ Newbie
 
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
Question How to create more than 2000 threads inlinux 2.4kernel


Hi
I am not able to create threads more than 255 in my linux machine(redhat 9,kernel 2.4). Anybody knows how to configure to get more than 2000 threads!!!!!
 
Old 07-11-2006, 08:11 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Personally I would not ask myself how to get 2000 threads, I would be asking:
Why do I need to 2000 threads?
Will I gain anything from having this many threads?
Will all the thread swapping nearly kill my machine?

As for the answer to your question, I'm sorry I don't know.
 
Old 07-11-2006, 08:17 AM   #3
FLLinux
Member
 
Registered: Jul 2004
Location: USA
Distribution: Fedora 9, LFS 6.3, Unbuntu 8.04, Slax 6.0.7
Posts: 145

Rep: Reputation: 15
I agree with dmail. Why do you need 2000 threads? Do you have the resources (Memory, CPU, etc..) to support that many threads?
 
Old 07-11-2006, 08:36 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Yes indeed, let's do the math...

Suppose that your machine has a 1 millisecond timer-quantum, which means that you get 1,000 of these puppies per second.

And you have 2,000 active threads.

Worst case, every one of them gets to execute for 1/1,000 of one second every two seconds.

Read my lips: you cannot create a "real world" server which depends upon "creating a thread for every request that it receives!" If you take this "flaming-arrow approach" in a real-world situation, you wind up with a bonfire.
 
Old 07-11-2006, 08:55 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
it's a funny old world
 
Old 07-11-2006, 09:12 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
The linux kernel 2.4 supports 8192 threads per processor.

On the 2.6 NPT, linux uses this:
typedef unsigned long int pthread_t

So you have quite a lot..

But if you use this number of threads, your cpu will be terribly slow. At least use the 2.6 which has a better performance when using a lot of thread.
 
  


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
Sql Server 2000 create Triggers? ati Programming 1 05-20-2006 12:30 PM
"Find all threads started by user" not showing all threads Nylex LQ Suggestions & Feedback 3 12-28-2005 08:28 PM
Java threads listed using kill -3 does not contain all threads found using ps -auxww coneheed Programming 2 11-14-2005 08:57 AM
BASH 2000 (windoze 2000 that is), or how i fell in love with the atomic bomb soylentgreen General 2 03-14-2005 11:23 PM
Java Threads vs Native Threads rjmendez Programming 0 08-16-2004 05:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:04 AM.

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