Didn't get: How do you implement custom locks in Java?
One minute response: Attend next week's lectures and do next week's readings to find out.
Didn't get: wait()
will put threads in the pool; notify()
will then take one out, but starvation is still possible. Does notifyAll()
have no starvation at all?
One minute response: Good question. Starvation is still possible with notifyAll()
because once released from the wait set, the treads queue up at the class-instance mutex, and now we're back to the unfair waiter selection allowed for mutex locking.
Didn't get: Implementing the immutability and how much is it of use.
One minute response: Implementing immutable class instances is fairly easy, assuming you are careful to prevent premature access to the instance during construction and you make sure the instance references are transitively immutable too.
Good concurrent programmers will recognize and exploit opportunities for immutable class instances when they write programs; wise concurrent programmers will design their solutions around, among other things, immutable objects whenever possible.
This page last modified on 16 July 2003.