Situations where deadlock could occur.
Anonymous
Deadlock occurs when two or more threads are trying to use resources that are being used by other threads. Example: There are two threads, T1 and T2. To complete a task both requires two resources, R1 and R2, that can be used at the soonest possible time within the program. When both threads start, T1 begins to use R1 and T2 begins to use R2. Although both T1 and T2 have there initial resources, they must use each others resources to complete the task before they can release these resources to other tasks. Basically, T1 needs to use R1 and R2 to complete its task before it can release R1 to T2; and T2 needs to use R1 and R2 to complete its task before it can release R2 to T1. Therefore, each task is waiting hypothetically forever (or not depending on the situation). This is one of many situations deadlock can occur.
Check out your Company Bowl for anonymous work chats.