IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Expensive thread startups...
Not really true. Both Solaris and NT keep thread pools which can be very quickly reused in this sort of situation. It's faster than a select loop. We have several programs that do exactly that, and the difference is apparent.
Regards,

-scott anderson
New That just underscores my point
Keeping pools of objects around so that you can reuse existing ones is an old optimization to avoid expensive creations. The very fact that this has been noted as a bottleneck and the optimization applied for thread creation is evidence that thread creation is expensive. Whether it works for you depends on your usage pattern, but if your process hangs around for a while, both asking for and returning objects, then the odds are very good that your usage pattern fits.

The fact that this can beat a select solution means little. As I mentioned, select has its own performance drawbacks. (Such as busy waits.) Similarly note that the performance of heavily threaded code is strongly OS dependent. It is no accident that you used NT and Solaris as your examples, but not Linux or HP-UX.

For more, a lot more, I find [link|http://www.kegel.com/c10k.html|The C10K Problem] a good read. I am fairly sure that you have seen it before, but there probably have been updates since you last read it, and there are a lot of links that are just plain good. Among other relatively recent additions are links (which I have admittedly not read) on how non-blocking I/O can be a performance win for Java.

Cheers,
Ben
     Java 1.4 non blocking I/O apis - (bluke) - (7)
         Back to the future: cooperative multi-tasking - (ben_tilly) - (2)
             Expensive thread startups... - (admin) - (1)
                 That just underscores my point - (ben_tilly)
         Oh look more crap from sunsoft - (tuberculosis) - (3)
             Carl Sagan meet Sunsoft: Billions and billions of classes.. -NT - (wharris2)
             Yes and no - (bluke) - (1)
                 Designing language - (tuberculosis)

Please... I can't take this kind of stimulation! I got Disney tunes running all through my head at just the thought of it.
43 ms