Re: How many threads is too many?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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


.



Relevant Pages

  • Adding New Users to Doman using AD does not work
    ... request to put in the ipconfig /all info, but i don't have the newsreader ... The computers were on dynamic IP, so i made it static and set the dns to ... I run gpupdate /force on the server and the w/s - ng ...
    (microsoft.public.windows.server.active_directory)
  • IPSEC with certificates on Windows XP (Certificate donīt have a private key )
    ... I have a question for the Microsoft CSP and IPSEC. ... I have installed a small network of 4 computers. ... computers and two windows 2000 computers. ... The program certreq.exe generate a certificate request. ...
    (microsoft.public.platformsdk.security)
  • Re: WSE464: No policy could be found for this message.
    ... wouldn't it reject every request? ... >> and over again from numerous computers. ... >> from MY computer, hitting the same webserver, I did not have the ... >> What type of event would cause this to disappear and then reappear. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Router incompatibility with Vista
    ... With computers being halted and brought up everyday the ... Most computer operating systems will request the last leased address ... when contacting the DHCP server, to provide continuity, and most ... difference between routers and computers providing DHCP services. ...
    (uk.telecom.broadband)
  • How many threads is too many?
    ... individually may do a small amount of work over a given period of time as ... every second each thread makes an http request for a file on a different server ... servers one after the other after each request it saves the file to disk ...
    (microsoft.public.dotnet.languages.csharp)