Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3) (20 pts) Consider the following lock requests in the table belovw Here, S(-)

ID: 3712271 • Letter: 3

Question

3) (20 pts) Consider the following lock requests in the table belovw Here, S(-) and X(-) stand for ‘Shared Lock, and 'Exclusive Lock, respectively. Ti, T2, and T3 represent three transactions. LM stands for 'lock manager' and Transactions will never release a granted lock. time 3 t6 t7 S(B) S(C) X(C) LMg For the lock requests in above table, decide which lock will be granted or blocked by LM. Write 'g' in the LM row to indicate the lock is granted and 'b' to indicate that the lock is blocked (the lock acquisition fails). For example, in the table, the first lock (S(A) at time t1) is marked as granted with 'g'. Moreover, show your work to justify your answer

Explanation / Answer

Lets begin with answer,

There are two types of locks:

1. Shared Lock S(A):

=> S(A) represents that a transaction is requesting for a shared lock on resource A, while a resource is shared lock, another transactions can gain shared lock on that resource but not an exclusive lock.

2. Exclusive Lock X(A):

=> X(A) represents that a transaction is requesting for an exclusive lock on resource A, while a resource is exclusive locked, another transactions cannot gain shared lock or exclusive lock.

Let solve question,

1. At t1 => S(A) by T1: granted as no lock on A.

2. At t2 => S(B) by T2: granted as no lock on B

3. At t3 => X(A) by T3: blocked as a shared lock on A.

4. At t4 => X(C) by T2: granted as no lock on C.

5. At t5 => S(B) by T1: granted as only shared lock on B.

6. At t6 => S(C) by T1: blocked as exclusive lock on C.

7. At t7 => X(B) by T2: blocked as shared lock on B.

This completes the answer, post queries in answer.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote