0 votes 0 votes In 2PL protocol if all exclusive locks are acquired by transaction in increasing order of their accesses then is the 2PL starvation free ? Databases databases transaction-and-concurrency test-series + – sumit chakraborty asked Nov 26, 2017 sumit chakraborty 1.2k views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments Ashwin Kulkarni commented Nov 26, 2017 reply Follow Share i have already explained conservative 2PL above but let's take this in depth. Let's say all locks are acquired by T1 initially, then T2 has to starve until T1 unlocks. and if some operation of T1 is taking too much time then T2 will surely starve. T1 T2 L_X(A) L_X(B) Execution A Now here B is taking too much time, Hence T2 has to wait until execution of B Then only T2 can aquire its locks and start its execution. execution of B Hence here Though lock on B in T1 is taken initially but B is taking too much time in T1 hence T2 has to starve untill T1 unlocks B. Because In T2 also X(A) and X(B) should be acquire at start of its execution 0 votes 0 votes Red_devil commented Nov 26, 2017 reply Follow Share @Ashwin Kulkarni so according to this Peterson's solution in OS should be not starvation free because we can't preempt any process while it is executing. 0 votes 0 votes Ashwin Kulkarni commented Nov 26, 2017 reply Follow Share You're talking about priority inversion problem in Peterson's solution. 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes It might help https://gateoverflow.in/102854/2pl-protocol Arpit Dhuriya answered Nov 26, 2017 selected Nov 26, 2017 by sumit chakraborty Arpit Dhuriya comment Share Follow See all 0 reply Please log in or register to add a comment.