In context of deadlock prevention in DBMS, wait-die and wound-wait schemes are…

2022

In context of deadlock prevention in DBMS, wait-die and wound-wait schemes are ........ techniques.

Answer: D. non-preemptive and preemptive respectivelyConceptTimestamp-based deadlock prevention assigns each transaction an age from its timestamp and permits waits only in one age direction, so a circular wait…

  1. A.

    both preemptive

  2. B.

    both non-preemptive

  3. C.

    preemptive and non-preemptive respectively

  4. D.

    non-preemptive and preemptive respectively

Attempted by 320 students.

Show answer & explanation

Correct answer: D

Concept

Timestamp-based deadlock prevention assigns each transaction an age from its timestamp and permits waits only in one age direction, so a circular wait cannot form.

A scheme is non-preemptive when the requesting transaction never forces the lock holder to roll back; it is preemptive when the requester can force the holder to roll back.

Application

  1. Wait-die: if the requester is older than the holder, it waits. If the requester is younger, the requester itself is rolled back and restarted with the same timestamp. Because the requester never displaces the holder, wait-die is non-preemptive.

  2. Wound-wait: if the requester is older than the holder, the younger holder is rolled back and the older requester proceeds. If the requester is younger, it waits. Because the requester can displace the holder, wound-wait is preemptive.

  3. Therefore, the applicable pairing is: wait-die is non-preemptive and wound-wait is preemptive, respectively.

Cross-check

The classification follows who can be rolled back: wait-die may roll back only the requester, whereas wound-wait may roll back the transaction already holding the lock.

Scheme

Older requester

Younger requester

Classification

wait-die

waits for the younger holder

rolls itself back

non-preemptive

wound-wait

rolls back the younger holder

waits for the older holder

preemptive

Result: wait-die is non-preemptive and wound-wait is preemptive, respectively.

Explore the full course: Hpsc Pgt Computer Science

Loading lesson…