Physics, asked by mano99, 2 months ago

what is lock table and how we can avoid our transaction from strarvation?​

Answers

Answered by mariya6043
1

Answer:

Starvation in DBMS

Starvation or Livelock is the situation when a transaction has to wait for a indefinite period of time to acquire a lock.

Reasons of Starvation –

If waiting scheme for locked items is unfair. ( priority queue )

Victim selection. ( same transaction is selected as a victim repeatedly )

Resource leak.

Via denial-of-service attack.

Starvation can be best explained with the help of an example – Suppose there are 3 transactions namely T1, T2, and T3 in a database that are trying to acquire a lock on data item ‘ I ‘. Now, suppose the scheduler grants the lock to T1(maybe due to some priority), and the other two transactions are waiting for the lock. As soon as the execution of T1 is over, another transaction T4 also come over and request unlock on data item I. Now, this time the scheduler grants lock to T4, and T2, T3 has to wait again. In this way if new transactions keep on requesting the lock, T2 and T3 may have to wait for an indefinite period of time, which leads to Starvation.

Similar questions