Re: How many threads?
- From: Lew <noone@xxxxxxxxxxx>
- Date: Mon, 04 Aug 2008 20:46:01 -0400
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
.
- References:
- Re: How many threads?
- From: Roger Lindsjö
- Re: How many threads?
- From: Tom Anderson
- Re: How many threads?
- From: Christian
- Re: How many threads?
- From: Tom Anderson
- Re: How many threads?
- From: Knute Johnson
- Re: How many threads?
- Prev by Date: Re: My prime counting function
- Next by Date: Re: How many threads?
- Previous by thread: Re: How many threads?
- Next by thread: Re: How many threads?
- Index(es):
Relevant Pages
|