answersLogoWhite

0

A Deadlock is a situation of indefinite waiting where the system is stuck at a particular point and would do nothing useful.

For example Method A is waiting for B's input while B is waiting for C's input and C in turn is waiting for A's input. Here all the 3 methods would continue to wait because they are waiting on one another and the system is stuck.

A deadlock usually occurs while using threads. Threads can lock objects on which they are processing and when multiple threads are waiting for the same object a Dead lock may occur.

The use of the synchronize keyword can be used to avoid such deadlock situations.

User Avatar

Wiki User

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
RossRoss
Every question is just a happy little opportunity.
Chat with Ross

Add your answer:

Earn +20 pts
Q: How deadlock is achieved in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp