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).