What is Concurrency? Expain with example Deadlock and Starvation.

 

 

Q) What is deadlock?
A) A deadlock is a condition when two or more threads are in waiting for each other to release the resources that they need. For example Thread A holds a resource X and need resource Y whereas Thread B holds a resource Y and need X, in this case both threads are waiting for each other to release the resource and are in blocked condition.