Powered by Blogger.

Deadlock

No comments :
A Special type of error that you need to avoid that relates specifically to multitasking is Deadlock, which occurs when two threads have a circular dependency on a pair of synchronization objects.
Deadlock is a difficult error to debug for two reasons.
  • In general, It occurs only rarely, when the two threads time-slice in just the right way.
  • It may involve more than two threads and two synchronization object.
Example: A example of Deadlock.

Output:

No comments :

Post a Comment

Please Write a Message for Programming or something Related issues.