You are not logged in.
Pages: 1
Hi All,
I have to make the resource checking. which include finding the maximum number of threads per process in the unix platforms. can you please help in understanding how to get the maximum number of thread per process on the major unix platform.
I know for HPUX ($/usr/sbin/kmtune | grep max_thread_proc)
but need to know for the rest of the platforms like (Solaris, AIX, Linux, MAC OSX)
I am sure there will be some command to get these details. please help me.
Thanks in advance...
The 'generic' method aka POSIX is via:
http://www.cognitus.net/html/howto/pthr … .html#s4_6
If you don't want to follow the link.. then its the value returned from the call sysconf( _SC_THREAD_THREADS_MAX ) ... where a -1 mean technically unlimited ( otherwise known - usually - as lazy kernel programmers )...
If you get a -1 then you must calculate the standard stack size per thread and apply that against the total memory ( including swap ) on the system...
It can get much more complicated than that... but i3839 made me drink tonight so I cannot remember the rest of the answer...
Bad i3839... bad bad bad... !!!
Michael
P.S. Ok - I had to blame SOMEONE and you were the only one online darn it !
"The only difference between me and a madman is that I'm not mad."
Salvador Dali (1904-1989)
Offline
Oh... and thats not 'per process'... technically its total thread count... but that count ( impls ) seems to be confused...
Either way - its a good starting point...
Must sleep now... nite... :)
"The only difference between me and a madman is that I'm not mad."
Salvador Dali (1904-1989)
Offline
But _SC_THREAD_THREADS_MAX gives the theoretical limit for a theoretical
system, if it doesn't return -1 as it does here, so it's totally useless.
I though he was interested in artificial limits anyway, like ulimit -u.
Of course the number of threads per process is limited by the amount of virtual
memory available, but that's true for everything that uses memory...
Offline
Back home... sober now... which makes me very sad but anyway...
Yeah...
The use of sysconf does actually work as expected on a lot of systems like HPUX / Solaris / AIX i.e. it returns a real value instead of the bogus -1 / unlimited value...
BUT... its the programmatic / in application way of retrieving the value... as opposed to ulimit and ilk that are used as command line utilities...
Michael
"The only difference between me and a madman is that I'm not mad."
Salvador Dali (1904-1989)
Offline
Pages: 1