Meenal:available() method does not work for me
I think you will appreciate this FAQ entry:
AvailableDoesntDoWhatYouThinkItDoes
Meenal:The threads need to perform I/O in the sense that they have to iterate through an InputStream object to find out its length( available() method does not work for me). So this becomes a processing intensive task in reality.
Also, certain methods which send requests to a remote server are made. These make the threads block/wait.
I think you need to profile your application a little to find out how much CPU is it actually using, if for huge load also the CPU is not consumed nearly 100% then that means that your work is not really CPU bound and may get a
boost by increasing number of threads. (Oh if you have an upper limit of max 5 threads then probably this is not an option)
BTW, it has become more of a performance question than Threads and Synchronization. I think we can move it to the performance forum.
(Moderators, time to pounce on this one
)
[ April 25, 2008: Message edited by: Nitesh Kant ]