Home

waitdie

Wait-die is a deadlock avoidance protocol used in database systems to manage concurrent access to shared data. It is a timestamp-based concurrency control scheme and is commonly discussed alongside the wound-wait protocol. In wait-die, each transaction receives a unique timestamp when it starts, which establishes a global order of transactions.

When a transaction requests a lock on a data item currently held by another transaction with a

This approach guarantees that no deadlocks occur, because a waiting chain cannot form a cycle with decreasing

Compared with wound-wait, where older transactions may abort younger ones to allow the older to proceed, wait-die

conflicting
lock,
the
protocol
applies
a
simple
rule.
If
the
requesting
transaction’s
timestamp
is
older
than
the
holder’s,
the
requester
waits
for
the
lock
to
be
released.
If
the
requester
is
younger,
it
is
aborted
(dies)
and
must
restart
with
a
new
timestamp.
Aborted
transactions
are
typically
rolled
back
to
the
point
before
the
lock
request
and
resubmitted.
ages.
However,
it
can
lead
to
starvation
for
younger
transactions
in
high-contention
workloads,
as
repeated
aborts
may
prevent
timely
progress.
Wait-die
is
commonly
used
with
two-phase
locking
and
can
be
implemented
in
both
centralized
and
distributed
database
environments.
reverses
the
direction:
older
transactions
wait,
younger
ones
are
aborted.
Each
policy
has
trade-offs
regarding
abort
frequency,
potential
starvation,
and
recovery
costs,
depending
on
workload
characteristics.
Implementations
require
careful
management
of
timestamps,
abort
and
restart
logic,
and
handling
of
long-running
lock
holders.
The
choice
between
wait-die
and
wound-wait
is
typically
guided
by
the
expected
contention
pattern
and
the
cost
of
aborts
versus
waits.