• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using wait - does this affect system performance? <---- gurus please

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(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.
 
Ranch Hand
Posts: 67
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
reply
    Bookmark Topic Watch Topic
  • New Topic