Thursday, June 24, 2010

Avoid Deadlock.

Step to prevent Deadlock :

Live Example :

By synchronizing the methods of the kitchen class, we are essentially preventing more than one cook from
using the kitchen at a time; the purpose of having multiple threads is to allow more than one cook to use the
kitchen.

Deadlock Code :

Here you will get clear picture for Deadlock :

http://www.itec.uni-klu.ac.at/~harald/CSE/Content/deadlock.html