deadlock (การติดตาย) คือสภาวะที่เธรดสองตัวขึ้นไปต่างถูก บล็อกตลอดกาล โดยแต่ละตัวรอทรัพยากรที่อีกตัวถืออยู่ ไม่มีอะไรคืบหน้า
สี่เงื่อนไขจำเป็น (Coffman)
ทั้งสี่ต้องเกิดขึ้นพร้อมกัน — กำจัดข้อใดข้อหนึ่งออกไป deadlock ก็เกิดไม่ได้:
text
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)
