Re: How many threads is too many?
- From: Leon Lambert <lambertl@xxxxxxxx>
- Date: Tue, 07 Mar 2006 05:59:50 -0600
Just something to keep in mind. For the near future computing speed is going to be gotten by going to multi-core computers. We will be seeing 4 computers on on chip soon and who knows how many more that will go up too. Single thread applications will not take advantage of this technology. So your application 2 would not take advantage of the new technologies coming to your desktop soon. Of course this doesn't mean hundreds of threads is a good thing.
Just something to think about :)
Leon Lambert
Alexander Walker wrote:
Hello.
Is it inefficient to create an application that has many threads that individually may do a small amount of work over a given period of time as opposed to an application that has a smaller number of threads that do a larger amount of work over a given time period
here is an oversimplified example
application 1 has 4 threads
every second each thread makes an http request for a file on a different server and then saves the file it requested to disk
application 2 has 1 thread
every second the thread makes four http requests for a file to four different servers one after the other after each request it saves the file to disk
you could say that application 1 and application 2 do the same thing, but they do it in different ways
how expensive is it to switch between threads?
image application 1 and 2 where doing something other than requesting files, such as reading or writing from a database or executing some operations on data
I ask this because I have a windows service that creates 4 threads, the number of threads it creates is variable so in the future it might create more threads or less threads, each thread performs an operation every second, should I be concerned about how many threads I'm creating? I think that I should, but I'm not sure how to determine how many threads is too many
thanks
Alex
- Follow-Ups:
- Re: How many threads is too many?
- From: Nick Hounsome
- Re: How many threads is too many?
- From: Willy Denoyette [MVP]
- Re: How many threads is too many?
- References:
- How many threads is too many?
- From: Alexander Walker
- How many threads is too many?
- Prev by Date: Re: Problem with a Regex
- Next by Date: Re: Compaing two arrays when element order does not matter
- Previous by thread: RE: How many threads is too many?
- Next by thread: Re: How many threads is too many?
- Index(es):
Relevant Pages
|