what difference between wait-die , wound-wait?
i found both techniques of deadlock prevention doing same thing( rollback of older process).
can body explain me ,what difference between them suitable example.
wait-die scheme: non-preemptive technique deadlock prevention. when transaction ti requests data item held tj, ti allowed wait if has timestamp smaller of tj (that ti older tj), otherwise ti rolled (dies).
in scheme, if transaction requests lock resource (data item), held conflicting lock transaction, 1 of 2 possibilities may occur −
(1) if ts(ti) < ts(tj) − ti, requesting conflicting lock, older tj − ti allowed wait until data-item available.
(2) if ts(ti) > ts(tj) − ti younger tj − ti dies. ti restarted later random delay same timestamp.
this scheme allows older transaction wait kills younger one.
for example:
suppose transaction t22, t23, t24 have time-stamps 5, 10 , 15 respectively. if t22requests data item held t23 t22 wait. if t24 requests data item held t23, t24 rolled back.
wound-wait scheme: preemptive technique deadlock prevention. counterpart wait-die scheme. when transaction ti requests data item held tj, ti allowed wait if has timestamp larger of tj, otherwise tj rolled (tj wounded ti).
in scheme, if transaction requests lock resource (data item), held conflicting lock transaction, 1 of 2 possibilities may occur −
(1) if ts(ti) < ts(tj), ti forces tj rolled − ti wounds tj. tj restarted later random delay same timestamp.
(2) if ts(ti) > ts(tj), ti forced wait until resource available.
this scheme, allows younger transaction wait; when older transaction requests item held younger one, older transaction forces younger 1 abort , release item.
for example:
suppose transactions t22, t23, t24 have time-stamps 5, 10 , 15 respectively . if t22requests data item held t23, data item preempted t23 , t23 rolled back. if t24 requests data item held t23, t24 wait.
in both cases, transaction enters system @ later stage aborted.
Comments
Post a Comment