The number of threads to run depends greatly on what else runs on the system. For example, MySQL can be configured as multi-threaded, which might cause you to want to reduce your application's thread count.
Another thing to consider is the design of your application. How much contention will there be? Can lots of your threads actually run totally concurrently, or will they constantly be competing for mutexes and other shared-resource mechanisms.
For Solaris especially, threads are far superior to independent processes. The context switch time between threads is much (>10x) faster than for processes.
As for memory usage per thread, it is really not possible. They are all within a single process structure. If you are using malloc to get memory, it comes from the process memory pool (which grows when necessary, up to the system limit). All the threads theoretically share all of this memory, even though only some might have references to any given part.
Oh, and by the way, if you are doing any TCP/IP in this application, and performance is important, you better upgrade to Solaris 10. I had a C application running on 5.8, and it turned out that in general, small amounts of data (less than TCP buffer size) would wait about 50ms before being passed to an application. They totally re-wrote the TCP/IP stack for 10, and this problem went away.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.