| Author |
using wait - does this affect system performance? <---- gurus please
|
byronc Ozzie
Greenhorn
Joined: Jul 12, 2010
Posts: 7
|
|
Hi,
we use wait (5000) a lot in our threaded systems. (we have our own object queues)
in jprofiler this comes up as a hotspot - this is not a bottle neck though right?
thanks
|
Byron
website design - my immigration to Sydney
|
 |
Martin Vanyavchich
Ranch Hand
Joined: Sep 16, 2008
Posts: 241
|
|
|
I'm not a guru, but I don't see how this could affect performance ... unless you get stuck with a lot of threads in the waiting pool. Even then, they get released in about 5000 miliseconds.
|
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
|
 |
Nitesh Kant
Bartender
Joined: Feb 25, 2007
Posts: 1638
|
|
(I feel this question is more appropriate for our performance forum)
Its very hard to point out whether it is a bottleneck or not unless you give us a clue about where it is used.
A simple i++ can also become a performance bottleneck if you do it a million times in the code path. In such a case, it will not be that i++ is non-performant but it is the code that uses it, is the problem.
For example if you have this wait for threads in a receiver thread pool in a server, you might as well looking at very low throughputs. So, without the context/code it is very hard to tell whether it actually is a problem or not.
|
apigee, a better way to API!
|
 |
Mike Peters
Ranch Hand
Joined: Oct 10, 2009
Posts: 67
|
|
|
It is just a wild guess, but it might be so, that your profiler prefers a call to wait() over a call to wait(timeout).
|
Mike Peters
|
 |
 |
|
|
subject: using wait - does this affect system performance? <---- gurus please
|
|
|