This content has been marked as final. Show 4 replies
Okay. What do you mean by "release the deadlock"? Deadlocks are something to fix permanently (IE. redesign your code so they don't happen), you don't try to deal with them in your code. At most I would put effort into being able to detect a deadlock if I suspect that one could happen; that is no easy thing to do however.
The proper fix is to make sure you never get a deadlock in the first place.
If you have multiple locks you need to always lock them in the same order. If you are using "Lock" objects you can try to lock both locks and unlock them if you don't get both.
A simpler approach is to use just one lock for both.
e.g. if you make both methods static, you won't get a dead lock.
hkcoder wrote:My point was that you posted and then waited a whole 19 minutes before bumping your post. Although questions are often answered within a minute or two of being posted, you shouldn't expect it. People will answer when they get around to it. Bugging them after only a few minutes like you did is rude. Please remember that in the future.
Thanks jverd...I understood the concept...
From now i'll take care of these things in case of Multithreaded communication...
Many thanks to all for your kind support.