# How is this situation a deadlock?Specially using 2PL?

**URL:** <https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023>\
**Category:** Uncategorized\
**Created:** [November 19, 2025, 11:49am UTC](https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023 "2025-11-19T11:49:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![polaryeti](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/polaryeti/32/19283_2.png) [@polaryeti](https://forum.kirupa.com/u/polaryeti)\
**Post date:** [November 19, 2025, 11:49am UTC](https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023/1 "2025-11-19T11:49:51Z")

</div>

Do not quite get it.

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/9/0/9043e4f22ca512edb387a0bc5781d925d55c997f.jpeg)

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [November 19, 2025, 11:04pm UTC](https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023/2 "2025-11-19T23:04:00Z")

</div>

It is because neither can proceed. They’re waiting on a lock held by the other, and neither will release its lock until it finishes. 2PL won’t help for the problem is in the waiting and not the locking.

---

<div class="post-metadata">

**Author:** ![polaryeti](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/polaryeti/32/19283_2.png) [@polaryeti](https://forum.kirupa.com/u/polaryeti)\
**Post date:** [November 20, 2025, 2:37am UTC](https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023/3 "2025-11-20T02:37:59Z")

</div>

just wait. i mean

---

<div class="post-metadata">

**Author:** ![prestige\_123](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@prestige\_123](https://forum.kirupa.com/u/prestige_123)\
**Post date:** [January 31, 2026, 5:11am UTC](https://forum.kirupa.com/t/how-is-this-situation-a-deadlock-specially-using-2pl/678023/4 "2026-01-31T05:11:48Z")

</div>

In 2PL, a deadlock happens when transactions hold locks and wait on each other in a circular chain.

In this case, T1 acquires a lock on resource A and requests B, while T2 already holds B and requests A. Since 2PL does not allow releasing locks before all required locks are acquired (during the growing phase), neither transaction can proceed.

So both transactions are waiting indefinitely:

T1 → waiting for B (held by T2)  
T2 → waiting for A (held by T1)

This circular wait condition is exactly what creates a deadlock under Two-Phase Locking.

-Prestige Safety Nets
