notifyAll
notifyAll is a method found in many object-oriented programming languages, particularly those that support concurrency and multithreading like Java. Its primary purpose is to wake up all threads that are currently waiting on the object's monitor.
When a thread calls a method like wait() on an object, it releases the lock on that
The notifyAll() method is invoked on an object by a thread that has acquired the object's lock.
Compared to notify(), which wakes up only one waiting thread, notifyAll() is often considered safer and less