Re: How many threads?



On Jul 30, 7:28 pm, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
I am about to do some multithreading code to get some parallelism when
waiting for Internet links to respond. The question comes How many
threads? Well it depend on too many things. How much ram, how fast the
connections, what else is going on in the machine.

The optimal choice could change over time, even within a single run.

What I need is some sort of homing mechanism that homes in on the
optimal number. Surely this is a common problem. Are there classes to
handle this automatically?
--

Roedy Green Canadian Mind Products
The Java Glossaryhttp://mindprod.com

I think that your problem calls for a blocking-queue/thread-pool
solution, with possibly an upper-bound to the number of threads --
IMHO, you're unlikely to exhaust a local resource (e.g. CPU or memory,
assuming a reasonably up-to-date box) given the amount of idle time
you'll encounter waiting for I/O while making asynch requests over the
Internet.
.



Relevant Pages

  • Re: How many threads?
    ... waiting for Internet links to respond. ... How much ram, how fast the ... What I need is some sort of homing mechanism that homes in on the ...
    (comp.lang.java.programmer)
  • Re: ?? re Balun and G5RV
    ... Brian Reay wrote: ... quote when or where I *ever* said otherwise". ... Still waiting, and I guess I will be for a long time! ... A common problem when something is learned "parrot fashion". ...
    (uk.radio.amateur)
  • Re: Samsung HLS-5087
    ... Art, That's not good. ... Does this seem to be a common problem with this model ... Maybe waiting was a good thing after ... that they have a very nice picture when working properly. ...
    (alt.tv.tech.hdtv)
  • Re: RFT: updatedb "morning after" problem [was: Re: -mm merge plans for 2.6.23]
    ... may well have been in idle time ... reduces the number will be a win - not to stay swap prefetch is the right ... I'm sure this is true while you are doing the swapout or swapin and the system is waiting for it. ...
    (Linux-Kernel)
  • Re: Anyone looking for a cheap Road King?
    ... Stedanko wrote... ... It's a common problem. ... I'm waiting for the right time to bring up the ... subject of a storage rental to the missus in order to store projects that ...
    (rec.motorcycles.harley)