Concurrency Anti-pattern Catalog for Java

Notify instead of notify all anti-pattern

Problem: If a notify() is executed instead of notifyAll() then threads with some of its corresponding wait() calls will not be notified [LDG+04].

Java example of the problem: ...

Context: Trying to coordinate threads.

Solution: Replace notify() with notifyAll().

Java example of the solution: ...


[LDG+04] B. Long, R. Duke, D. Goldson, P. A. Strooper, and L. Wildman, “Mutation-based exploration of a method for verifying concurrent Java components," in Proc. of the 2nd Interna- tional Workshop on Parallel and Distributed Systems: Testing and Debugging (PADTAD 2004), Apr. 2004.