Entries Tagged as 'Strict'

Strict two-phase locking

In computer science, strict two-phase locking (Strict 2PL) is a locking method used in concurrent systems.

The two rules of Strict 2PL are:

  1. If a transaction T wants to read/write an object, it must request a shared/exclusive lock on the object.
  2. All exclusive locks held by transaction T are released when T commits (and not before).

Here is an example of Strict 2PL in action with interleaved actions.

<math>

D = \begin{bmatrix}
T1 & T2 \\
S(A) & \\
R(A) & \\

      & S(A)   \\
      & R(A)   \\
      & X(B)   \\
      & R(B)   \\
      & W(B)   \\
      & Commit \\

X(C) & \\
R(C) & \\
W(C) & \\
Commit &
\end{bmatrix}
</math>

or in text form:

T1: S(A), R(A); T2: S(A), R(A), X(B), R(B), W(B), Commit; T1: X(C), R(C), W(C), Commit

where

  • S(O) is a shared lock action on an object O
  • X(O) is an exclusive lock action on an object O
  • R(O) is a read action on an object O
  • W(O) is a write action on an object O

Strict 2PL prevents transactions reading uncommitted data, overwriting uncommitted data, and unrepeatable reads. Thus, it prevents cascading rollbacks, since eXclusive locks (for write privileges) must be held until a transaction commits.


Strict 2PL does not guarantee a deadlock-free schedule

Avoiding deadlocks can be important in real time systems, and may additionally be difficult to enforce in distributed data bases, or fault tolerant systems with multiple redundancy.

A deadlocked schedule allowed under Strict 2PL:

<math>G = \begin{bmatrix}

T1 & T2\\
X(A) & \\

 & X(B) &  \\

X(B) & \\

& X(A) \end{bmatrix}</math>

Text:
T1: X(A) T2:X(B) T1:X(B) T2: X(A)

T1 is waiting for T2’s lock on B to be released, while T2 is waiting for T1’s lock on A to be released. These transactions cannot proceed and both are deadlocked.

There is no general solution to the problem of deadlocks in computing systems, so they must be anticipated and dealt with accordingly. Nonetheless, several solutions such as the Banker’s algorithm or the imposition of a partial ordering on lock acquisition exist for avoiding deadlocks under certain conditions.

Even more strict than strict two-phase locking is rigorous two-phase locking, in which transactions can be serialized by the order in which they commit. Under rigorous 2PL, all locks (shared and exclusive) must be held until a transaction commits. Most database systems use strict 2PL.

Strict two-phase locking

In computer science, strict two-phase locking (Strict 2PL) is a locking method used in concurrent systems.

The two rules of Strict 2PL are:

  1. If a transaction T wants to read/write an object, it must request a shared/exclusive lock on the object.
  2. All exclusive locks held by transaction T are released when T commits (and not before).

Here is an example of Strict 2PL in action with interleaved actions.

<math>

D = \begin{bmatrix}
T1 & T2 \\
S(A) & \\
R(A) & \\

      & S(A)   \\
      & R(A)   \\
      & X(B)   \\
      & R(B)   \\
      & W(B)   \\
      & Commit \\

X(C) & \\
R(C) & \\
W(C) & \\
Commit &
\end{bmatrix}
</math>

or in text form:

T1: S(A), R(A); T2: S(A), R(A), X(B), R(B), W(B), Commit; T1: X(C), R(C), W(C), Commit

where

  • S(O) is a shared lock action on an object O
  • X(O) is an exclusive lock action on an object O
  • R(O) is a read action on an object O
  • W(O) is a write action on an object O

Strict 2PL prevents transactions reading uncommitted data, overwriting uncommitted data, and unrepeatable reads. Thus, it prevents cascading rollbacks, since eXclusive locks (for write privileges) must be held until a transaction commits.


Strict 2PL does not guarantee a deadlock-free schedule

Avoiding deadlocks can be important in real time systems, and may additionally be difficult to enforce in distributed data bases, or fault tolerant systems with multiple redundancy.

A deadlocked schedule allowed under Strict 2PL:

<math>G = \begin{bmatrix}

T1 & T2\\
X(A) & \\

 & X(B) &  \\

X(B) & \\

& X(A) \end{bmatrix}</math>

Text:
T1: X(A) T2:X(B) T1:X(B) T2: X(A)

T1 is waiting for T2’s lock on B to be released, while T2 is waiting for T1’s lock on A to be released. These transactions cannot proceed and both are deadlocked.

There is no general solution to the problem of deadlocks in computing systems, so they must be anticipated and dealt with accordingly. Nonetheless, several solutions such as the Banker’s algorithm or the imposition of a partial ordering on lock acquisition exist for avoiding deadlocks under certain conditions.

Even more strict than strict two-phase locking is rigorous two-phase locking, in which transactions can be serialized by the order in which they commit. Under rigorous 2PL, all locks (shared and exclusive) must be held until a transaction commits. Most database systems use strict 2PL.

Strict conditional

In logic, a strict conditional is a material conditional that is acted upon by the necessity operator from modal logic. For any two propositions <math>p</math> and <math>q</math>, the formula <math>p \rightarrow q</math> says that <math>p</math> materially implies <math>q</math> while <math>\Box (p \rightarrow q)</math> says that <math>p</math> strictly implies <math>q</math>. Strict conditionals are the result of Clarence Irving Lewis’s attempt to find a conditional for logic that can adequately express indicative conditionals. Such a conditional would, for example, avoid the paradoxes of material implication. The following statement, for example, is not correctly formalized by material implication.

If Bill Gates had graduated in Medicine, then Elvis never died.

This condition is clearly false: the degree of Bill Gates has nothing to do with whether Elvis is still alive. However, the direct encoding of this formula in classical logic using material implication lead to:

Bill Gates graduated in Medicine <math>\rightarrow</math> Elvis never died.

This formula is true because a formula <math>A \rightarrow B</math> is true whenever the antecedent <math>A</math> is false. Hence, this formula is not an adequate translation of the original sentence. Strict conditions are encodings of implications in modal logic attempting A different encoding is:

<math>\Box</math> (Bill Gates graduated in Medicine <math>\rightarrow</math> Elvis never died.)

In modal logic, this formula means (roughly) that, in every possible world in which Bill Gates graduated in Medicine, Elvis never died. Since one can easily imagine a world where Bill Gates is a Medicine graduate and Elvis is dead, this formula is false. Hence, this formula seems a correct translation of the original sentence.

Although the strict conditional is much closer to being able to express natural language conditionals than the material conditional, it has its own problems. The following sentence, for example, is not correctly formalized by a strict conditional:

If Bill Gates graduated in Medicine, then 2 + 2 = 4.

Using strict conditionals, this sentence is expressed as:

<math>\Box</math> (Bill Gates graduated in Medicine <math>\rightarrow</math> 2 + 2 = 4)

In modal logic, this formula means that, in every possible world where Bill Gates graduated in medicine, it holds that 2 + 2 = 4. Since 2 + 2 is equal to 4 in all possible worlds, this formula is true. While it is clearly not the case that 2 + 2 = 4 if Bill Gates graduated in medicine, the corresponding strict material statement is true.

To avoid the paradoxes of strict implication, some logicians have created counterfactual conditionals. Others, such as Paul Grice, have used conversational implicature to argue that, despite apparent difficulties, the material conditional is just fine as a translation for the natural language ‘if…then…’. Others still have turned to relevant logic to supply a connection between the antecedent and consequent of provable conditionals.


See also

  • Counterfactual conditional
  • Indicative conditional
  • Material conditional
  • Logical implication


References

  • Edgington, Dorothy, 2001, “Conditionals,” in Goble, Lou, ed., The Blackwell Guide to Philosophical Logic. Blackwell.

For an introduction to non-classical logic as an attempt to find a better translation of the conditional, see:

  • Priest, Graham, 2001. An Introduction to Non-Classical Logic. Cambridge Univ. Press.

For an extended philosophical discussion of the issues mentioned in this article, see:

  • Mark Sainsbury, 2001. Logical Forms. Blackwell Publishers.
  • Jonathan Bennett, 2003. A Philosophical Guide to Conditionals. Oxford Univ. Press.

Strict weak ordering

In mathematics, especially order theory, a strict weak ordering is a binary relation < on a set S that is a strict partial order (a transitive relation that is irreflexive, or equivalently, that is asymmetric) in which the relation “neither a < b nor b < a” is transitive.

The equivalence classes of this “incomparability relation” partition the elements of S, and are totally ordered by <. Conversely, any total order on a partition of S gives rise to a strict weak ordering in which x < y if and only if there exists sets A and B in the partition with x in A, y in B, and A < B in the total order. Strict weak orders are often used in microeconomics to model preferences.

As an example, consider the partial order in the set {a, b, c} defined by the relationship b < c. The pairs a,b and a,c are incomparable but b and c are related, so incomparability does not form an equivalence relation and this example is not a strict weak ordering.


Properties

A strict weak ordering has the following properties. For all x and y in S,

  • For all x, it is not the case that x < x (irreflexivity).
  • For all xy, if x < y then it is not the case that y < x (antisymmetry).
  • For all x, y, and z, if x < y and y < z then x < z (transitivity).
  • For all x, y, and z, if x is incomparable with y, and y is incomparable with z, then x is incomparable with z (transitivity of equivalence).

Note that this list of properties is somewhat redundant, as antisymmetry follows readily from irreflexivity and transitivity. Transitivity of equivalence can also be stated in the following simpler form:

  • If x < y, then for all z either x < z or z < y (or both).


Total preorders

Strict weak orders are very closely related to total preorders or (non-strict) weak orders, and the same mathematical concepts that can be modeled with strict weak orderings can be modeled equally well with total preorders. A total preorder or weak order is a preorder that is total; that is, no pair of items is incomparable. A total preorder ≤ satisfies the following properties:

  • For all x, y, and z, if x <math>\lesssim</math> y and y <math>\lesssim</math> z then x <math>\lesssim</math> z (transitivity).
  • For all x and y, x <math>\lesssim</math> y or y <math>\lesssim</math> x (totality).
    • Hence: for all x, x <math>\lesssim</math> x (reflexivity).

A total order is a total preorder which is antisymmetric, in other words, which is also a partial order.

The complement of a strict weak order is a total preorder, and vice versa, but it seems more natural to relate strict weak orders and total preorders in a way that preserves rather than reverses the order of the elements. Thus we take the inverse of the complement: for a strict weak ordering <, define a total preorder <math>\lesssim</math> by setting x <math>\lesssim</math> y whenever it is not the case that y < x. In the other direction, to define a strict weak ordering < from a total preorder <math>\lesssim</math>, set x < y whenever it is not the case that y <math>\lesssim</math> x.

For a strict weak order “<” another associated reflexive relation is its , a (non-strict) partial order “≤”. The two associated reflexive relations differ with regard to different a and b for which neither a < b nor b < a: in the total preorder we get a <math>\lesssim</math> b and b <math>\lesssim</math> a, while in the (non-strict) partial order we get neither ab nor ba. For strict total orders these two associated reflexive relations are the same: the corresponding (non-strict) total order.

In any preorder there is a where two elements x and y are defined as equivalent if x <math>\lesssim</math> y and y <math>\lesssim</math> x. In the case of a total preorder the corresponding partial order on the set of equivalence classes is a total order. Two elements are equivalent in a total preorder if and only if they are incomparable in the corresponding strict weak ordering.


Representing weak orderings by functions

If X is any set and f a real-valued function on X then f induces a strict weak order on X by setting

  • a < b if and only if f(a) < f(b)

The associated total preorder is given by

  • a <math>\lesssim</math> b if and only if f(a) ≤ f(b)

and the associated equivalence by

  • a <math>\sim</math> b if and only if f(a) = f(b)

The relations do not change when f is replaced by g o f (composite function), where g is a strictly increasing real-valued function defined on at least the range of f.

Thus e.g. a defines a preference relation.

If X is finite, every weak order can be represented by a function in this way (see, e.g., , Theorem 3.1).
However, there exist strict weak orders that have no corresponding real function. For example, there is no such function for the lexicographic order on Rn. Thus, while in most preference relation models the relation defines a utility function up to order-preserving transformations, there is no such function for lexicographic preferences.

More generally, if X is a set, and Y is a set with a strict weak ordering “<”, and f a function from X to Y, then f induces a strict weak ordering on X by setting

  • a < b if and only if f(a) < f(b)

The associated total preorder is given by

  • a <math>\lesssim</math> b if and only if f(a) <math>\lesssim</math> f(b)

and the associated equivalence by

  • a <math>\sim</math> b if and only if f(a) <math>\sim</math> f(b)

f is not necessarily an injective function, so for example a class of 2 equivalent elements on Y may induce a class of 5 equivalent elements on X. Also f is not necessarily an surjective function, so a class of 2 equivalent elements on Y may induce a class of only one element on X, or no class at all. There is a corresponding injective function g that maps the partition on X to that on Y. Thus, in the case of finite partitions, the number of classes in X is less than or equal to the number of classes on Y.


Examples

On the 2-dimensional real plane:

  • f(x,y)= x+y
  • f(x,y)= min(x,y)

In the case of preferences with regard to an amount of x of one product and y of the other, the first corresponds to the case that the products can replace each other, the other that they can only be used in combination.


The number of total preorders

The number of distinct total preorders on an n-element set is given by the following sequence :

These numbers are also called the Fubini numbers or ordered Bell numbers.

As explained above, there is a 1-to-1 correspondence between total preorders and pairs (partition, total order). Thus the number of total preorders is the sum of the number of total orders on every partition. For example:

  • for n=3:

    • 1 partition of 3, giving 1 total preorder (each element is related to each element)
    • 3 partitions of 2+1, giving 3 × 2 = 6 total preorders
    • 1 partition of 1+1+1, giving 6 total preorders (the total orders)
i.e. together 13 total preorders.
  • for n=4:

    • 1 partition of 4, giving 1 total preorder (each element is related to each element)
    • 7 partitions with two classes (4 of 3+1 and 3 of 2+2), giving 7 × 2 = 14 total preorders
    • 6 partitions of 2+1+1, giving 6 × 6 = 36 total preorders
    • 1 partition of 1+1+1+1, giving 24 total preorders (the total orders)
i.e. together 75 total preorders.

Compare the Bell numbers, here 5 and 15: the number of partitions, i.e., the number of equivalence relations.


Strict total order

A strict weak order that is trichotomous is called a strict total order. The total preorder which is the inverse of its complement is in this case a total order.


References

  • Transaction Management File Format: PDF/Adobe Acrobat - View as HTMLStrict 2PL - improves on 2PL by guaranteeing that every allowed schedule is Strict 2PL - transaction T must obtain a shared or exclusive lock before it
  • 1 Concurrency Control More ! Review: Two-Phase Locking (2PL) Lock File Format: PDF/Adobe Acrobat - View as HTMLschemes (Strict 2PL, 2PL). Locks directly implement. the notions of conflict. of objects, even Strict 2PL (on individual items) will not
  • Lecture 1: Course Introduction and Overview File Format: PDF/Adobe Acrobat - View as HTMLStrict Two-phase Locking (Strict 2PL) Protocol Strict 2PL allows only serializable schedules .. Two Phase Locking and Strict 2PL: Locks implement
  • 2003 Paper 13 Question 8 File Format: PDF/Adobe Acrobat - View as HTML(i) By considering some possible schedules of the above transactions, describe. carefully the concurrency permitted by strict 2PL using just shared/read
  • Strict 2PL Strict 2PL:. If T wants to read an object, first obtains an S lock. If T wants to modify an object, first obtains X lock.
  • Microsoft PowerPoint - ConcurrencyControl.ppt File Format: PDF/Adobe Acrobat - View as HTMLNo deadlocks, more concurrency than Conservative Strict 2PL. ° But need to know objects a priori, .. fixed collection of objects, even Strict 2PL will
  • CSE 536 File Format: Microsoft Powerpoint - View as HTML2PL -> serializable. 4. CMSC 536 (lect 13). Strict Two Phase Locking. Strict 2PL. A transaction always reads a value written by a committed transaction
  • Outline File Format: Microsoft Powerpoint - View as HTMLStrict 2PL. Hold locks until the end. Obtain lock. Release lock. BEGIN. END. Transaction There is only one 2PL scheduler in the distributed system.
  • Distributed Transaction Management Two-Phase Locking (2PL). Strict 2PL. Centralized 2PL. Distributed 2PL. Distributed 2PL Execution. Timestamp Ordering. Conservative Timestamp Ordering
  • Reducing Recovery Constraints on Locking based Protocols* serializable. executions. However, the most implemented. version of 2PL is strict. 2PL. In strict 2PL, a transaction. does not release the locks until
  • Microsoft PowerPoint - Ch17_CC File Format: PDF/Adobe Acrobat - View as HTMLcontrol schemes (Strict 2PL, 2PL). Conflicts. between transactions can be detected in the. dependency graph. The lock manager keeps track of the locks
  • CSC742 Homework 7 File Format: PDF/Adobe Acrobat - View as HTMLStrict 2PL with timestamps used for deadlock prevention. Wait_die: Strict 2PL with deadlock detection. (Show the waits-for graph if a deadlock cycle

Strict two-phase locking

In computer science, strict two-phase locking (Strict 2PL) is a locking method used in concurrent systems.

The two rules of Strict 2PL are:

  1. If a transaction T wants to read/write an object, it must request a shared/exclusive lock on the object.
  2. All exclusive locks held by transaction T are released when T commits (and not before).

Here is an example of Strict 2PL in action with interleaved actions.

<math>

D = \begin{bmatrix}
T1 & T2 \\
S(A) & \\
R(A) & \\

      & S(A)   \\
      & R(A)   \\
      & X(B)   \\
      & R(B)   \\
      & W(B)   \\
      & Commit \\

X(C) & \\
R(C) & \\
W(C) & \\
Commit &
\end{bmatrix}
</math>

or in text form:

T1: S(A), R(A); T2: S(A), R(A), X(B), R(B), W(B), Commit; T1: X(C), R(C), W(C), Commit

where

  • S(O) is a shared lock action on an object O
  • X(O) is an exclusive lock action on an object O
  • R(O) is a read action on an object O
  • W(O) is a write action on an object O

Strict 2PL prevents transactions reading uncommitted data, overwriting uncommitted data, and unrepeatable reads. Thus, it prevents cascading rollbacks, since eXclusive locks (for write privileges) must be held until a transaction commits.


Strict 2PL does not guarantee a deadlock-free schedule

Avoiding deadlocks can be important in real time systems, and may additionally be difficult to enforce in distributed data bases, or fault tolerant systems with multiple redundancy.

A deadlocked schedule allowed under Strict 2PL:

<math>G = \begin{bmatrix}

T1 & T2\\
X(A) & \\

 & X(B) &  \\

X(B) & \\

& X(A) \end{bmatrix}</math>

Text:
T1: X(A) T2:X(B) T1:X(B) T2: X(A)

T1 is waiting for T2’s lock on B to be released, while T2 is waiting for T1’s lock on A to be released. These transactions cannot proceed and both are deadlocked.

There is no general solution to the problem of deadlocks in computing systems, so they must be anticipated and dealt with accordingly. Nonetheless, several solutions such as the Banker’s algorithm or the imposition of a partial ordering on lock acquisition exist for avoiding deadlocks under certain conditions.

Even more strict than strict two-phase locking is rigorous two-phase locking, in which transactions can be serialized by the order in which they commit. Under rigorous 2PL, all locks (shared and exclusive) must be held until a transaction commits. Most database systems use strict 2PL.