Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model?

I) There is no advantage over the strict model.

II) In contrast to the strict model, it guarantees that starvation cannot occur.

III) In contrast to the strict model, it guarantees that deadlock cannot occur.

IV) In contrast to the strict model, there is no need to predict data needed in the future.

My note says all of the above are false. I am a bit confused. Can someone clarify for me why all of this is false?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
473 views
Welcome To Ask or Share your Answers For Others

1 Answer

What is Two-Phase Locking (2PL) Protocol ?

A transaction is two-phase locked if:

before reading x, it sets a read lock on x

before writing x, it sets a write lock on x

it holds each lock until after it executes the corresponding operation

after its first unlock operation, it requests no new locks

Now, what is Strict phase locking ?

Here a transaction must hold all its exclusive locks till it commits/aborts.

But ,whats rigorous 2PL ?

Rigorous two-phase locking is even stricter: here all locks are held till commit/abort. In this protocol transactions can be serialized in the order in which they commit.

Much deeper :

Strict 2PL :

enter image description here

Same as 2PL but Hold all exclusive locks until the transaction has already successfully committed or aborted. –It guarantees cascadeless recoverability

Rigorous 2PL :

enter image description here

Same as Strict 2PL but Hold all locks until the transaction has already successfully committed or aborted. –It is used in dynamic environments where data access patterns are not known before hand.

There is no deadlock. Also, a younger transaction requesting an item held by an older transaction is aborted and restart with the same timestamp, starvation is avoided.

I hope that above clear explanations with diagram must have made you clear about the concept and advantages of rigorous over the other.

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...