Posts

Showing posts with the label Difference




Explain Difference Between Notify and Notifyall Methods

Image
2 notify method. Before understanding the differences between both of them lets understand the similarities between them. Differences Between Executor And Executorservice In Java Java Java Programming Tutorials Java Programming The notify method is used to wake up a single thread. . Differences between notify of and notifyAll of in Java Explain two concepts first. The Sender uses the send method to send data to the Receiver. Notify Wakes up a single thread that is waiting on this objects monitor. Answer 1 of 2. First and main difference between notify and notifyAll method is that if multiple thread is waiting on any lock in Java notify only inform one of waiting thread while notifyAll informs all threads waiting on that lock. Notify method is used if all your waiting threads are interchangeable or if you only ever have one waiting thread. In a multi threaded environment multiple threads might try to modify...