Deadlock भनेको त्यो अवस्था हो जहाँ दुई वा बढी thread हरू प्रत्येक सधैंका लागि block हुन्छन्, प्रत्येकले अर्कोले समातेको resource कुरिरहन्छ। केही पनि अगाडि बढ्दैन।
चार आवश्यक (Coffman) सर्तहरू
चारै एकैचोटि सत्य हुनुपर्छ — कुनै एउटा हटाउनुहोस् र deadlock असम्भव हुन्छ:
1. Mutual exclusion → a resource is held exclusively (only one holder at a time)
2. Hold and wait → a thread holds one resource while waiting to acquire another
3. No preemption → resources can't be forcibly taken; only released voluntarily
4. Circular wait → a cycle: T1 waits for R2 (held by T2), T2 waits for R1 (held by T1)
