Re: How many threads?
- From: shakah <shakahshakah@xxxxxxxxx>
- Date: Wed, 30 Jul 2008 16:45:49 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: How many threads?
- From: Mark Space
- Re: How many threads?
- References:
- How many threads?
- From: Roedy Green
- How many threads?
- Prev by Date: How many threads?
- Next by Date: Re: Compile Date
- Previous by thread: How many threads?
- Next by thread: Re: How many threads?
- Index(es):
Relevant Pages
|