In a database system, unique timestamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the timestamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp. If TS(T2) < TS(T1) then T1 is killed else T2 waits. Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?

In a database system, unique timestamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the timestamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp. If TS(T2) < TS(T1) then T1 is killed else T2 waits. Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks? Correct Answer The database system is both deadlock-free and starvation-free.

Concept:

Wound – wait scheme means the newer transactions are killed when an older transaction make a request for a lock being held by newer transaction.

Explanation:

Here, Unique timestamps are assigned to each transaction using Lamport’s logical clock.

1) Now, first check if is it wound – wait scheme?

If TS(T2) < TS(T1) then

T1 is killed

else T2 waits.

This logic comes under wound – wait scheme, because it is given that T1 holds a lock on the resource R and T2 has requested a lock on same resource R. When T2 requests, T1 is killed because timestamp of T1 ­is larger than T2 means T1 is the newer transaction.

2) Now, wound – wait avoid starvation or not?

As newer transaction dies and restart with same timestamp and older one survives so after older transaction new will definitely execute. It means no possibility of starvation.

3) Deadlock free or not?

As, there is no starvation in this means no deadlock possibility.

Related Questions

The following are the conditions for selecting list of a suitable candidates to be called for interview after the written test for the recruitment is conducted/ organized for management-level persons of a multi-national company. For providing accounting services and sales the candidate must (a) be holding a graduation in basic science with 65% or above or B.E degree with 55% and above marks (b) have passed the written test with 70% or above marks (c) the age must be in the group 25 to 30 yrs as on 1/4/18 (d) have experience in an accounting firms for three yrs and diploma in accounting with 60% or above marks (e) be presently drawing CTC of 6 Lakhs per annum and above In case the applicant who satisfies all other terms above except 1) at (a) above, then be referred as Junior Accountant 2) at (d) & (e) above then be referred as Trainee-Accountant Satisfying all the above with experience of 5 yrs then be referred as senior-Accountant Satisfying all the above criteria (a-e) with CA/ ICWA/ MBA (Finance) then be refereed as manager (Accounts) Read all the above information and answer the following question: Radha Mohan has done her graduation in physics with 58% of marks. She has passed the written examination with 76% of marks. She is 27 yrs as on June 2018. She has the experience in the accounting company for four years with salary of 7 Lakhs per annum. She also has passed diploma in accounting with 61% of marks. She may be referred for the position of:
The following are the conditions for selecting list of a suitable candidates to be called for interview after the written test for the recruitment is conducted/ organized for management-level persons of a multi-national company. For providing accounting services and sales the candidates must (a) be holding a graduation in basic science with 65% or above or B. E degree with 55% and above marks (b) have passed the written test with 70% or above marks (c) the age must be in the group 25 to 30 years as on 1/4/18 (d) have experience in an accounting firms for three years and diploma in accounting with 60% or above marks (e) be presently drawing CTC of 6 Lakhs per annum and above In case the applicant who satisfies all other terms above except 1) at (a) above, then be referred as Junior Accountant 2) at (d) & (e) above then be referred as Trainee-Accountant Satisfying all the above with experience of 5 years then be referred as senior-Accountant Satisfying all the above criteria (a-e) with CA/ ICWA / MBA (Finance) then be refereed as manager (Accounts) Read all the above information and answer the following question Shravani has passed H. SC with 72% of marks. She has done diploma in accountancy with 62% of marks. She was working with an organization in the field of accounting in the field of accounting from 4 years and was drawing CTC of 6.5 Lakhs presently. She is 28yrs as on July 2018. She may referred for the position of: