Will more number of waiting threads in thread pool degrade performance?

Hi, I use thread pool and set the maximum number of threads to execute. My problem is, the thread pool initiates the number of threads and these threads wait until they get a work. Will this degrade the performance (The threads do I/O operations) ?
[262 byte] By [FaridSubhana] at [2007-10-3 3:31:38]
# 1

Threads waiting for work will not degrade performance. If your work involves those threads waiting for I/O then that in itself will not degrade performance either (as long as they block and don't poll of course).

All live threads consume resources however so if you are short on threads or memory then don't create too many of them.

Pre-starting a large number of threads in a pool can cause a startup delay of course. Generally you should let the pool create threads as needed until it gets to the core pool size.

davidholmesa at 2007-7-14 21:25:41 > top of Java-index,Core,Core APIs...
# 2
thank u davidholmes.My Application initiates hundreds of threads with sleep interval 100 ms and wait. So as u said, they will be consuming the CPU. Thank u for ur suggestions.regards,Farid.
FaridSubhana at 2007-7-14 21:25:41 > top of Java-index,Core,Core APIs...
# 3

Well of course it will slow down things a bit, lists in kernel space get longer, more work needs to be done by the scheduler and becaus eof larger data structures L2 cache misses are likely to happen.

You should set a useful value which makes sence instead of a too large "fits ever" value.

lg Clemens

linuxhippya at 2007-7-14 21:25:41 > top of Java-index,Core,Core APIs...
# 4
I would be worried about a design "with sleep interval 100 ms and wait". You should try and re-factor your design to use blocking I/O or wait/notify (depending on what work you are doing)
dannyyatesa at 2007-7-14 21:25:41 > top of Java-index,Core,Core APIs...