Re: How many threads?



Knute Johnson wrote:
Sorry I came to this thread late but I remember here a while back I did some experiments on the number of threads on Windows XP. I found once you got past 75-100 things got really slow. That was on my dual core machine and one with more processors would probably do much better.

I think in many cases you might do much better with schedulers and fewer threads. Less system overhead and memory use.

I have also read, sources now unfortunately forgotten, that Windows generally supports fewer simultaneous threads than Linux. I have also read that Linux in its default configurations doesn't support as many threads as it could, given the correct kernel options.

I was just reading the chapter(s) in Brian Goetz's /Java Concurrency in Practice/ that deals with the overhead of threads. They impose context switches that can kill performance and undo the benefits of parallelism if there are too many threads, if there is a lot of lock contention.

This is in addition to the overhead of synchronization, which forces parts of the program to operate serially instead of in parallel.

Threads can improve performance but they don't come for free.

--
Lew
.



Relevant Pages

  • Re: Tight compute loops -> no context switch
    ... between overhead and responsiveness to asynchronous events that was designed back in the early days of Dolphin. ... IMNAWP (I am not a Windows programmer), but wouldn't it be possible to have a windows thread wait on a periodic timer and set or increment a memory location that the main VM process could then test, just like it tests the message/jump count? ... Seems like the overhead for the main VM process would be exactly the same as it is now. ... First this produces a ridiculously high event poll frequency on fast machines running normal Smalltalk code. ...
    (comp.lang.smalltalk.dolphin)
  • Re: slow file transfer speeds on SBS
    ... There is some overhead with windows as it sets up for the copy so 15 seconds ... Given the overhead created by windows and the performance expectiations of ... >> Regards, ...
    (microsoft.public.windows.server.sbs)
  • Re: Why does TM even want that new machine?
    ... This is before you add all the application overhead that it takes to make the OS "safe" for the Windows XP user. ... The 'application overhead' takes less than you might think, unless of course someone opts to use one of those resource hogs like Norton AV, or Kaspersky, which is just flat out unnecessary. ... Note - this uses no memory from bootup, as I only use it occasionally as a followup scan to Microsoft's Antispyware scans, and it also provides additional protection via blocking in my hosts file in addition to Spywareblaster. ...
    (comp.sys.mac.advocacy)
  • Re: Windows NFS client to access Linux (Fedora & Suse) hosts
    ... One, the overhead isn't that much, two, you can share disk ... The main problem I have with Samba relates to funny characters in ... Most Windows programs cannot open files over an SMB ...
    (comp.os.linux)
  • Re: Alternatives to Intel TBB/ Cilk?
    ... viable choice today and it is Windows and XBox only. ... For parallelism, use ...
    (comp.lang.functional)