Impossibilities for disjoint access parallel transactional memory
This presentation is the property of its rightful owner.
Sponsored Links
1 / 34

Impossibilities for Disjoint-Access Parallel Transactional Memory : PowerPoint PPT Presentation


  • 84 Views
  • Uploaded on
  • Presentation posted in: General

Impossibilities for Disjoint-Access Parallel Transactional Memory :. [Guerraoui & Kapalka, SPAA 08]. [Attiya, Hillel & Milani, SPAA 09]. Alessia Milani. Read X Write X Read Z Read Y. Transactional Synchronization.

Download Presentation

Impossibilities for Disjoint-Access Parallel Transactional Memory :

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Impossibilities for disjoint access parallel transactional memory

Impossibilities for Disjoint-Access Parallel Transactional Memory :

[Guerraoui & Kapalka, SPAA 08]

[Attiya, Hillel & Milani, SPAA 09]

Alessia Milani


Transactional synchronization

Read X

Write X

Read Z

Read Y

Transactional Synchronization

  • A transaction is a sequence of operations by a single process on a set of shared data items (data set) to be executed atomically

    • Like in database systems

  • A transaction ends either by committing

    • all of its updates take effect

      or by aborting

    • no update is effective

ABORT


Implementing transactional memory in software

base obj

base obj

Implementing Transactional Memory in Software

  • Data representation for transactions and data items

-------------------------------------------------------

High-level

operations

on data items

Low-level primitives operations (read, write,

CAS…) on base objects (memory locations)

Algorithms

33


Tm must provide

TM must provide

Serializability[Papadimitriou, 1979]

  • Any interleaving of the transactions yields a result that can be achieved in a sequential execution of the same set of transactions (aserialization)

    Strict Serializability[Papadimitriou, 1979]

  • … and the serialization must preserve the real-time order of (non-overlapping) transactions

44


Dap disjoint access parallelism

T1

X2

X1

T1

Read(Y)

Write(X1)

T3

T2

Write(X2)

T2

T3

Read(X2)

Read(X1)

DAP : Disjoint Access Parallelism

T1

Disjoint data sets  no contention

Data sets are connected  may contend

T2

Improves scalability for large data structures by reducing interference

5

Inherent Limitations on TMs


Dap more formally

Concurrently execute a low-level operation

DAP : More Formally

[Israeli & Rappaport, 1994]

An STM implementation is disjoint access parallel if two transactions T1 and T2 contend on the same base object ONLY IFthe data sets of T1 and T2 are connected

The data sets of T1 and T2 either intersect or are connected via other transactions

66

6

Inherent Limitations on TMs


Strict disjoint access parallelism

T1

X2

X1

T1

Read(Y)

Write(X1)

T3

T2

Write(X2)

T2

T3

Read(X2)

Read(X1)

Strict Disjoint Access Parallelism

[Guerraoui & Kapalka, SPAA 08]

  • Two transactions conflict on a low level base object only if their data sets intersect

    • T1 and T2 cannot contend on a same base object

T1

T2

Contend on the base object and one operation writes into it


Strict dap versus dap

Strict DAP versus DAP

  • Allows read-read contention for not connected transactions

  • But indirectly connected transactions cannot conflict


An impossibility

An impossibility

[Guerraoui & Kapalka, SPAA 08]

Theorem.No obstruction free TM isStrictly Disjoint Access Parallel

The proof is by contradiction

99

9


By contradiction

Before s : x and y both equal 0

After s : y =1

Read(w)0, Read(z)0

Write(x,1), Write(y,1)

s

T1

T1

By contradiction

Cmt

  • Assume a strictly DAP obstruction free TM exists

  • T1 runs solo  commits (obstruction freedom)


Proof

Read(x)0,Write(w,1)

T2

Cmt

Proof

Before s : x and y both equal 0

After s : y =1

Read(w)0, Read(z)0

Write(x,1), Write(y,1)

s

T1

T1

  • T2 runs solo  commits (obstruction freedom)


Proof1

Read(w)0, Read(z)0

Write(x,1), Write(y,1)

s

T1

T1

Read(x)0,Write(w,1)

T2

Cmt

Read(y)1,Write(z,1)

T3

Cmt

Proof

Before s : x and y both equal 0

After s : at least one between

x and y is equal 1

  • T2 and T3 have disjoint data set  T2 “invisible” to T3 (strictly DAP)  T3 reads y equal 1

  • T3 runs solo  should commit (obstruction freedom)


Completing the proof

Completing the Proof

Read(w)0, Read(z)0

Write(x,1), Write(y,1)

s

T1

T1

Read(x)0,Write(w,1)

T2

Cmt

  • If T1 commits, the execution is not serializable because of the read by T2, but

  • If T1 does not commit, the execution is not serializable because of the read by T3

Read(y)1,Write(z,1)

T3

Cmt

Contradiction to the existence of

a strict DAP obstruction free TM


With disjoint access parallel

…with Disjoint Access Parallel

  • Previous theorem does not hold

  • In fact…DAP can be ensured by an obstruction free TM implementation

    • DSTM [Herlihy, Luchangco, Moir & Scherer]

1414

14


Optimizing for read only transactions

Optimizing for Read-Only Transactions

Transactions that only observe the data

  • Empty write set

  • Be invisible (not write to base objects)

    • Avoid contention for the memory

  • Always terminate successfully (wait-free)

  • 1515

    15

    Inherent Limitations on TMs


    Optimizing for read only transactions1

    Optimizing for Read-Only Transactions

    Transactions that only observe the data

    • Empty write set

  • Be invisible (not write to base objects)

    • Avoid contention for the memory

  • Always terminate successfully (wait-free)

  • 1616

    16

    Inherent Limitations on TMs


    Some known stms

    Some Known STMs…

    17

    17


    Inherent tradeoff

    Inherent Tradeoff

    Theorem.There is no TM implementation that isDAPand hasinvisible and wait-free read-only transactions

    The proof relies on the notion of flippable execution, originally presented to prove lower bounds for atomic snapshot objects

    [Israeli & Shirazi] [Attiya, Ellen & Fatourou]

    1818

    18

    Inherent Limitations on TMs


    Flippable execution w 2 updaters

    A complete transaction in which p1 writes l-1 to X1

    A read-only transaction by q that reads X1 , X2

    Flippable Execution w/ 2 Updaters

    U0 … Ul-1 … Uk

    Ek

    p1

    U1 … Ul …

    p2

    q

    s1 … sl-1sl … sk

    1919


    Flippable execution w 2 updaters1

    U0 … Ul-1 … Uk

    Ek

    p1

    U1 … Ul …

    p2

    q

    s1 … sl-1sl … sk

    Flippable Execution w/ 2 Updaters

    Indistinguishable from executions where the order of (each pair of) consecutive updates is flipped…either forward or backward

    2020

    20


    Flippable execution backward flip

    U0 … Ul-1 … Uk

    U0 … Ul-1 … Uk

    Ek

    Fk

    p1

    p1

    U1 … Ul …

    U1 … Ul …

    p2

    p2

    q

    q

    s1 … sl-1sl … sk

    s1 … sl-1sl … sk

    Flippable Execution: Backward Flip

    Backward flip


    Impossibilities for disjoint access parallel transactional memory

    Lemma 1.In a flippable execution the read-only transaction cannot terminate successfully

    • Relies on Strict Serializability

    2222

    22

    Inherent Limitations on TMs


    Serialization of ek

    U0 … Ul-1 … Uk

    Ek

    p1

    U1 … Ul …

    p2

    q

    s1 … sl-1sl … sk

    U0 Ul-1 Uk

    U1 … Ul …

    Serialization of Ek

    Serialization of Ek

    Returns (l-1,l-2)

    Serialization point

    2323

    23

    Inherent Limitations on TMs


    Nowhere to serialize

    U0 … Ul-1 … Uk

    Ek

    p1

    U1 … Ul …

    p2

    q

    s1 … sl-1sl … sk

    U0 Ul-1 Uk

    U1 … Ul …

    Serialization of Ek

    U0 Ul -1 Uk

    U1 … Ul …

    Nowhere to Serialize

    Returns (l-1,l-2)

    U0 … Ul-1 … Uk

    Fk

    p1

    U1 … Ul …

    p2

    Still returns (l-1,l-2)

    q

    s1 … sl-1sl … sk

    x

    x

    x

    Backward flip

    X1 = l-3

    X2= l-2

    X1 = l-3

    X2= l

    X1 = l-1

    X2= l

    Serialization of Fk


    Constructing a flippable execution

    Constructing a Flippable Execution

    Lemma 2.In a DAP TM, two consecutive transactions writing to different data items do not contend on the same base object

    2525

    25


    Proof of lemma 2

    Last write to o

    U1

    p1

    1

    1

    First access to o

    U2

    2

    2

    p2

    Proof of Lemma 2

    By contradiction assume that U1 and U2 contend on a same base object

    o is the last base object written by U1 that U2 accesses

    2626

    26


    Proof of lemma 21

    Last write to o

    U1

    p1

    p1

    1

    1

    First access to o

    U2

    2

    2

    p2

    p2

    U1

    1

    1

    2

    2

    U2

    Proof of Lemma 2

    Serial execution of U1 and U2

    Overlapping execution of U1 and U2

    • U1 and U2 have disjoint data sets & contend on a base object

    Not a DAP Implementation


    A flippable execution exists

    A flippable execution exists

    • The steps of the read-only transaction can be removed (since it is invisible)

    • Since their data sets are disjoint, transactions Ul & Ul-1 do not “communicate” (by Lemma 2)

      • Can be flipped

    2828

    28

    Inherent Limitations on TMs


    Completing the proof1

    Completing the Proof

    By Lemma 1, the read-only transaction cannot terminate successfully

    If aborts, we can apply the same argument again…

    2929

    29

    Inherent Limitations on TMs


    Also a lower bound

    Also a lower bound

    In a strict serializable DAP TM, where read-only transactions are wait-free, a transaction with a data set of size t must write to t-1 base objects


    Weaker liveness condition

    OUR RESULTS

    STILL HOLD

    Weaker Liveness Condition

    • If a transaction runs alone from a quiescent configuration then it terminates successfully

    • Obstruction-freedom

      • A transaction (eventually) running solo, terminates successfully

    • Weakly progressiveness


    Weaker tm consistency

    OUR RESULTS

    STILL HOLD

    OPEN PROBLEM

    Weaker TM Consistency

    • Serializability

    • Snapshot Isolation

    • Causal Consistency

    • Causal Serializability


    Weakening dap

    Weakening DAP

    • Our impossibility result still holds when considering a weakernotion of DAP thatallows read-read contention (not connected transactions can read a same base object)

      • T1 and T2 can read a same base object


    To summarize

    To summarize

    Theorem.No obstruction free TM isStrictly DAP

    Theorem.There is no TM implementation that isDAPand hasinvisible and wait-free read-only transactions

    3434


  • Login