Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can deadlocks be solved using wait() and notify() ?

843789May 7 2010 — edited May 8 2010
I am trying to understand multithreading in Java and I intentionally created a deadlock using 2 objects and 2 threads by means of the synchronized statement, which wait indefinitely on each other, thus invoking a deadlock situation. My question is whether it is possible to solve the deadlock scenario using wait() and notify()? Or are the latter methods used to solve other kinds of problems ? Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2010
Added on May 7 2010
10 comments
1,332 views