Alex Rivera | Logout

Difference between Synchronized block with wait/notify and without them?

Asked 2011-10-20T21:06:36.187
26

If I just use synchronized, not the wait/notify methods, will it still be thread-safe?

What's the difference?

Edit
Report

1 Answer

3

Effective Java item 69: "Given the difficulty of using wait and notify correctly, you should use the higher-level concurrency utilities instead."

Avoid using wait() and notify(): use synchronized, or other utilities from java.util.concurrent, when possible.

answered 2011-10-20T21:32:28.357

Your Answer