The various locking protocols

COM1317 Spring 2001 -- Professor Futrelle

6/5/01


A student asked about the differences between the locking protocols:

"Strict two-phase", "two-phase", "non two-phase", and "non-strict two-phase" locking?

"Non two-phase" locking allows locks to be granted and released at any time, subject only to the conflict rules. Thus, a lock can only be granted if it does not conflict, but once obtained, can be released immediately after the operation is done or at any later time up until the end of the transaction. (Conflict table, Fig. 23.12)

"Two-phase" locking requires that there is a period of time during which locks are granted and once all the locks that will be required are granted, there follows a phase in which locks are only released. Other than this restriction, there are no other restrictions on the time at which the locks are granted or released. (pg. 836)

"Strict concurrency control" requires that write locks be held until the end of a transaction but read locks can be held until the end of the transaction. But the locking still is required to be two-phase. (This is an additional locking protocol, beyond what the student asked about. pg. 837)

"Strict two-phase" locking holds all locks until commit time, once granted. (pg. 837)

"Non-strict two-phase" locking, as far as I can see, is another name for any lock protocol which is two-phase but not strict. So this would be identical to "two-phase". But the phrase is used just to emphasize the non-strictness of any such protocol.

You should realize that other authors may use slightly different definitions or terminology, but results such as the theorem on two-phase locking are rigorous results based on an agreed-to definition of that protocol. (pg. 836)

-- Prof. Futrelle