A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2002-12-10 02:35 PM

Registered: 2002-10-24
Posts: 3

Re: Maximum or Optimal Number of Threads

Hi All,
Please tell me how many number of threads i can have in a Single process.
Now in My Application i have created 5 threads. I want to create more than 10 threads. is that possible?how much is the max or optimal?
instead of going for 10 Threads in a process if i split in to number of process, will it give a speed..Please Advise me as soon as possible.

Thanks in Advance


#2 2002-12-11 02:30 AM

From: Sol 3
Registered: 2002-06-12
Posts: 911

Re: Maximum or Optimal Number of Threads

See the answer under the threads section...

"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)


#3 2003-09-17 03:15 PM

Registered: 2002-08-01
Posts: 191

Re: Maximum or Optimal Number of Threads

borland tell users: max eficient number of threads is 16. :) I use 3 or 4 thread with no problem , but 2 always do nothing - wait on connection via accept.

I test some stuff and i work with 512 or up 2048 thread. It work nice for 3 GHZ pentium on socket server, becose lot of time thread wait via select and do nothing. But when you in all thread do heavy work, best is use max 2 threads.

you can change limit in linux by command uname specifi max. number of process. And set smaller stack size. Whe is stack szie 8 MB default on my redhat9, 1 GB RAM, i cant create more how ~250 threads.  tuning stack to 512 kb, 10000 threads was created well.


Board footer

Powered by FluxBB