एक deadlock वह स्थिति है जहाँ दो या अधिक threads प्रत्येक हमेशा के लिए 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)
