Regarding "signal" vs. "signalAll", you can check my old thread:
Well, it does a little, but compared to active waiting it should not be a problem. You would need to implement per record waiting to avoid waking up threads, which are waiting upon different records.
"We have presented this section on having multiple notification objects as it does
appear to meet a requirement listed in some of the sun instructions. However,
at the time of this writing Sun does not appear to penalize those candidates who
ignore this requirement"
Originally posted by Chris Be:
This is a somewhat counterintuitive, especially for junior programmers - and apparently testers. With the given design, I can follow the tester's train of thought when he would expect a ReentrantLock to be locked when leaving the method (thinking along the lines of approach 1).
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
Free, earth friendly heat - from the CodeRanch trailbosshttps://www.kickstarter.com/projects/paulwheaton/free-heat