I hate to speak for someone else, but I believe that Tim may have been
referring to the tendency of some people to use threads without
understanding their limitations. (I've seen attempts to massively
thread CPU-bound applications on single CPU machines.)

Threads are not magic that can be spread on a program to make it
"better".

That being said. Tim did not say "don't" he asked "why".<grin/> That's
much politer than I've normally been to people in a similar
circumstance.
<shrug/>

G. Wade

[EMAIL PROTECTED] wrote:
> 
> > From: Tim Funk <funkman () joedog ! org>
> > Subject: Re: [Q] Is it safe to create threads in Tomcat web-apps?
> 
> > You can create threads all day in tomcat, but here are the importnatn things
> > to consider:
> 
> > - WHY! Are threads really the correct solution?
> > - And last but not least: WHY! Are threads really the correct solution?
> 
> I'm getting the impression that you think multiple threads are never
> the right answer.  :) That's not necessarily true.
> 
> Suppose that your response to a request contains three steps which are
> independant of one another; in order to deliver a faster response
> time, you'd like to execute them concurrently.
> 
> If these three steps are CPU-bound, then the amount of benefit really
> depends on the machine; you need multiple CPUs so that the scheduler
> can run the different threads on different CPUs.  With a single CPU,
> you're not likely to see much benefit.
> 
> However, if the three steps are IO-bound, using multiple threads to
> run them concurrently can lead to a big improvement.  Most of the time
> spent doing IO is spent waiting.  (Particularly if the IO is network
> IO, a "sub-request" to a remote site, for example).  If the idle times
> occur concurrently instead of serially, you'll certainly do better.
> 
> --
> Steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to