Ref: Effective Java by Joshua Bloch
Threads should not busy-wait, repeatedly checking a shared object waiting for something to happen. Busy-waiting greatly increases the load on the processor, reducing the amount of useful work that others can accomplish. An extreme example of what not to do, consider this perverse implementation of CountDownLatch
No comments:
Post a Comment