Top Banner
An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs Sandeep Kulkarni 2 Sweta Kumari 1 Sathya Peri 1 Archit Somani 1 1 Department of Computer Science Engineering, IIT Hyderabad 2 Department of Computer Science, Michigan State University IIT Hyderbad MV-OSTMs 1 / 37
64

An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Apr 12, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

An Innovative Approach for Achieving Composability inConcurrent Systems using Multi-Version Object Based

STMs

Sandeep Kulkarni2 Sweta Kumari1 Sathya Peri1

Archit Somani1

1Department of Computer Science Engineering, IIT Hyderabad2Department of Computer Science, Michigan State University

IIT Hyderbad MV-OSTMs 1 / 37

Page 2: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 2 / 37

Page 3: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 3 / 37

Page 4: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Introduction to STMs

Software Transactional Memory

What is a transaction?

Sequence of instructions executing in memory.

Satisfying ACI

What is Software Transactional Memory?

A parallel programming paradigm

Avoids concurrency overheads at programmers level

Execute code optimistically

Methods of STMs :

Read

Write

TryC

IIT Hyderbad MV-OSTMs 4 / 37

Page 5: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Introduction to STMs

Software Transactional Memory

What is a transaction?

Sequence of instructions executing in memory.

Satisfying ACI

What is Software Transactional Memory?

A parallel programming paradigm

Avoids concurrency overheads at programmers level

Execute code optimistically

Methods of STMs :

Read

Write

TryC

IIT Hyderbad MV-OSTMs 4 / 37

Page 6: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Introduction to STMs

Software Transactional Memory

What is a transaction?

Sequence of instructions executing in memory.

Satisfying ACI

What is Software Transactional Memory?

A parallel programming paradigm

Avoids concurrency overheads at programmers level

Execute code optimistically

Methods of STMs :

Read

Write

TryC

IIT Hyderbad MV-OSTMs 4 / 37

Page 7: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 8: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 9: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 10: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 11: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 12: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 13: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 14: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 15: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 16: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 17: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 18: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Illustration of STMs methods

T2T1

T1’s Local Log T2’s Local Log

Memory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T1’s Local Log T2’s Local Log

Memory

Read fromMemory

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

T2’s Local Log

Memory

T1’s Local Log

Write to local Log

T2T1

Write to local Log

T2’s Local Log

Memory

T1’s Local Log

T2T1

Memory

T1’s Local Log T2’s Local Log

T2

Validate T1’s Log

T1

Memory

T2’s Local Log

T2T1

T1’s Log Permanent

Memory

T2’s Local Log

T1 Committed

T1

T1’s Log Permanent T2’s Log Validated

T2

Memory

T1 Committed

T1

T1’s Log Permanent

T2

Memory

T1 Committed T2 Aborted

Figure: Working of STM System

IIT Hyderbad MV-OSTMs 5 / 37

Page 19: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

Page 20: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Correctness of STM System

Correcness criteria for STMs (Opacity)

A history H is opaque if there exists a serial history S s.t.1 Operations of H and S are same2 S respects real time order ≺RT

H and3 ∀ trans(Ti ) ∈ S are legal in S

IIT Hyderbad MV-OSTMs 7 / 37

Page 21: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Correctness of STM System

Correcness criteria for STMs (Opacity)

A history H is opaque if there exists a serial history S s.t.1 Operations of H and S are same2 S respects real time order ≺RT

H and3 ∀ trans(Ti ) ∈ S are legal in S

IIT Hyderbad MV-OSTMs 7 / 37

Page 22: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Correctness of STM System

Example of opacity

H: r1(x,0)w2(x,10)w2(y,10)C2r1(y,A)A1

w2(x , 10) w2(y , 10)

A1r1(x , 0)

C2

T1

T2

r1(y ,A)

Figure: Opaque History H

A1r1(y ,A)r1(x , 0)T1

w2(x , 10) w2(y , 10)C2

T2

Figure: Equivalent serial history S: T1, T2

IIT Hyderbad MV-OSTMs 8 / 37

Page 23: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Correctness of STM System

Example of opacity

H: r1(x,0)w2(x,10)w2(y,10)C2r1(y,A)A1

w2(x , 10) w2(y , 10)

A1r1(x , 0)

C2

T1

T2

r1(y ,A)

Figure: Opaque History H

A1r1(y ,A)r1(x , 0)T1

w2(x , 10) w2(y , 10)C2

T2

Figure: Equivalent serial history S: T1, T2

IIT Hyderbad MV-OSTMs 8 / 37

Page 24: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 9 / 37

Page 25: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Problem with read-write STM

k2 k5 k7 k8 k9

Figure: A sample concurrent object

r1(k5) w2(k5) r1(k5)w2(k7)

T2

r2(k2) r2(k5) r1(k8)r1(k2)

T1

r1(k2) r2(k7)

Figure: Tree Structure : conflicts are (r1(k5), w2(k5)) and (w2(k5), r1(k5)

IIT Hyderbad MV-OSTMs 10 / 37

Page 26: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Problem at read-write level

r1(k5) w2(k5) r1(k5)w2(k7)

T2

r2(k2) r2(k5) r2(k7)r1(k2) r1(k8)r1(k2)

T1

Figure: Tree Structure

T2T1

Figure: Cycle (Not Serial)

IIT Hyderbad MV-OSTMs 11 / 37

Page 27: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Problem at read-write level

r1(k5) w2(k5) r1(k5)w2(k7)

T2

r2(k2) r2(k5) r2(k7)r1(k2) r1(k8)r1(k2)

T1

Figure: Tree Structure

T2T1

Figure: Cycle (Not Serial)

IIT Hyderbad MV-OSTMs 11 / 37

Page 28: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 12 / 37

Page 29: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMIntroduction

Object-based STMs (OSTM) operate on higher level objects ratherthan primitive read & writes which act upon memory locations.

OSTM model can adapted:

OSTM for stacks may export t push, t pop & t peek.OSTM for sets may export t begin(), t insert(), t del(), t lookup() andtryC().

IIT Hyderbad MV-OSTMs 13 / 37

Page 30: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMIntroduction

Object-based STMs (OSTM) operate on higher level objects ratherthan primitive read & writes which act upon memory locations.

OSTM model can adapted:

OSTM for stacks may export t push, t pop & t peek.OSTM for sets may export t begin(), t insert(), t del(), t lookup() andtryC().

IIT Hyderbad MV-OSTMs 13 / 37

Page 31: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMExecution at layer-1

k2 k5 k7 k8 k9

Figure: A sample representing a OSTM object

Layer-1: Lookups & Deletes

Layer-0: Reads

r2(k2) r2(k5) r2(k7) w2(k7) r1(k2)

d2(k7)

T2

c2

r1(k5) r1(k5)w2(k5)

l1(k5) l1(k8)

r1(k2) r1(k8)

T1

& Writes

Figure: Tree Structure : no conflict at Layer-1

IIT Hyderbad MV-OSTMs 14 / 37

Page 32: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMExecution at layer-1

d2(k7)

T2

l1(k5) l1(k8)

T1

Figure: Pruned Tree

l1(k8) d2(k7)

T2

l1(k5)

T1

Figure: Sequential Schedule

T2T1

Figure: Serial History

IIT Hyderbad MV-OSTMs 15 / 37

Page 33: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMExecution at layer-1

d2(k7)

T2

l1(k5) l1(k8)

T1

Figure: Pruned Tree

l1(k8) d2(k7)

T2

l1(k5)

T1

Figure: Sequential Schedule

T2T1

Figure: Serial History

IIT Hyderbad MV-OSTMs 15 / 37

Page 34: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMExecution at layer-1

d2(k7)

T2

l1(k5) l1(k8)

T1

Figure: Pruned Tree

l1(k8) d2(k7)

T2

l1(k5)

T1

Figure: Sequential Schedule

T2T1

Figure: Serial HistoryIIT Hyderbad MV-OSTMs 15 / 37

Page 35: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

OSTMProblem with OSTM

T1

T2

A1

C2

Lu1(ht, k2, nil)

Ins2(ht, k2, v2) Del2(ht, k1, nil)

Lu1(ht, k1,Abort)

Figure: Single version OSTM

IIT Hyderbad MV-OSTMs 16 / 37

Page 36: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 17 / 37

Page 37: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMAdvantages of multi-version over single version OSTM

T1

T2

A1

C2

Lu1(ht, k2, nil)

Ins2(ht, k2, v2) Del2(ht, k1, nil)

Lu1(ht, k1,Abort)

Figure: Single version OSTM

T1

T2

C2

C1Lu1(ht, k2, nil)

Ins2(ht, k2, v2) Del2(ht, k1, nil)

Lu1(ht, k1, nil)

Figure: Multi-version OSTM (MV-OSTM) : (T1, T2)

IIT Hyderbad MV-OSTMs 18 / 37

Page 38: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMAdvantages of multi-version over single version OSTM

T1

T2

A1

C2

Lu1(ht, k2, nil)

Ins2(ht, k2, v2) Del2(ht, k1, nil)

Lu1(ht, k1,Abort)

Figure: Single version OSTM

T1

T2

C2

C1Lu1(ht, k2, nil)

Ins2(ht, k2, v2) Del2(ht, k1, nil)

Lu1(ht, k1, nil)

Figure: Multi-version OSTM (MV-OSTM) : (T1, T2)

IIT Hyderbad MV-OSTMs 18 / 37

Page 39: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMIllustration of data structure

a) Underlying DS

k7 k8 +∞k1−∞ k5

IIT Hyderbad MV-OSTMs 19 / 37

Page 40: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMIllustration of data structure cont’d..

VL(Version List)

RVL(Return Value List)

b) DS for maintaining Versions

k1

0 v0 rvl1T

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

IIT Hyderbad MV-OSTMs 20 / 37

Page 41: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMLookup method

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

Figure: Lookup on key k1 by T13

IIT Hyderbad MV-OSTMs 21 / 37

Page 42: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMLookup method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

Figure: T13 searching appropriate place in version list of k1

IIT Hyderbad MV-OSTMs 22 / 37

Page 43: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMLookup method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13 201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

Figure: T13 successfully added into rvl1

IIT Hyderbad MV-OSTMs 23 / 37

Page 44: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

40

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

Figure: Insert a version of key k1 by T40

IIT Hyderbad MV-OSTMs 24 / 37

Page 45: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

40

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23 35

rvl3

Figure: T40 searching appropriate place in version list of k1

IIT Hyderbad MV-OSTMs 25 / 37

Page 46: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method cont’d..

k1

0 v0 rvl1T

13 201675 2827 30

15 v5 F rvl2

12 18 23 35

40 F rvl3v1525 F rvl3v10

Figure: T40 successfully created a new version of k1

IIT Hyderbad MV-OSTMs 26 / 37

Page 47: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

40

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23

rvl3

45c

Figure: Insert a version of key k1 by T40

IIT Hyderbad MV-OSTMs 27 / 37

Page 48: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

40

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23

rvl3

45c

Figure: T40 searching appropriate place in version list of k1

IIT Hyderbad MV-OSTMs 28 / 37

Page 49: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Proposed Algorithm : MV-OSTMtryC : Insert method cont’d..

VL(Version List)

RVL(Return Value List)

k1

0 v0 rvl1T

13

40

201675 2827 30

15 v5 F rvl2 25 v10 F

12 18 23

rvl3

45c

Figure: Abort T40 : T45 committed before T40

IIT Hyderbad MV-OSTMs 29 / 37

Page 50: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 30 / 37

Page 51: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Correctness of MV-OSTM

Theorem

Any history H generated by MV-OSTM algorithm with a given versionorder �, if OPG (H,�) is acyclic, then H is opaque.

IIT Hyderbad MV-OSTMs 31 / 37

Page 52: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 32 / 37

Page 53: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Conclusion

MV-OSTM is opaque.

We have proposed a new STM as MV-OSTM which providing thegreater concurrency in terms of the number of aborts with the help ofmultiple versions and composability.

Lookup operation always succeeds.

Delete operation is logically deletes, in that sense it’s lazy.

Transactions are composable [Harris et.al, 2005], [Ziv et.al, 2015].

IIT Hyderbad MV-OSTMs 33 / 37

Page 54: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Conclusion

MV-OSTM is opaque.

We have proposed a new STM as MV-OSTM which providing thegreater concurrency in terms of the number of aborts with the help ofmultiple versions and composability.

Lookup operation always succeeds.

Delete operation is logically deletes, in that sense it’s lazy.

Transactions are composable [Harris et.al, 2005], [Ziv et.al, 2015].

IIT Hyderbad MV-OSTMs 33 / 37

Page 55: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Conclusion

MV-OSTM is opaque.

We have proposed a new STM as MV-OSTM which providing thegreater concurrency in terms of the number of aborts with the help ofmultiple versions and composability.

Lookup operation always succeeds.

Delete operation is logically deletes, in that sense it’s lazy.

Transactions are composable [Harris et.al, 2005], [Ziv et.al, 2015].

IIT Hyderbad MV-OSTMs 33 / 37

Page 56: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Conclusion

MV-OSTM is opaque.

We have proposed a new STM as MV-OSTM which providing thegreater concurrency in terms of the number of aborts with the help ofmultiple versions and composability.

Lookup operation always succeeds.

Delete operation is logically deletes, in that sense it’s lazy.

Transactions are composable [Harris et.al, 2005], [Ziv et.al, 2015].

IIT Hyderbad MV-OSTMs 33 / 37

Page 57: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Conclusion

MV-OSTM is opaque.

We have proposed a new STM as MV-OSTM which providing thegreater concurrency in terms of the number of aborts with the help ofmultiple versions and composability.

Lookup operation always succeeds.

Delete operation is logically deletes, in that sense it’s lazy.

Transactions are composable [Harris et.al, 2005], [Ziv et.al, 2015].

IIT Hyderbad MV-OSTMs 33 / 37

Page 58: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

Outline

1 Introduction to STMs

2 Correctness Criteria of STMs

3 Problem with read-write STM

4 Object Based STMs

5 Motivation towards MV-OSTM

6 Correctness of MV-OSTM

7 Conclusion

8 Future Work

IIT Hyderbad MV-OSTMs 34 / 37

Page 59: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

ProgressFuture Work

Garbage Collection.

We will extend it for K-version MV-OSTM.

We will implement our proposed protocol and compare theperformance with existing Object-Based STMs [Hassan et.al, 2014].

Nesting : open [Yang et.al, 2007] and close.

IIT Hyderbad MV-OSTMs 35 / 37

Page 60: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

ProgressFuture Work

Garbage Collection.

We will extend it for K-version MV-OSTM.

We will implement our proposed protocol and compare theperformance with existing Object-Based STMs [Hassan et.al, 2014].

Nesting : open [Yang et.al, 2007] and close.

IIT Hyderbad MV-OSTMs 35 / 37

Page 61: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

ProgressFuture Work

Garbage Collection.

We will extend it for K-version MV-OSTM.

We will implement our proposed protocol and compare theperformance with existing Object-Based STMs [Hassan et.al, 2014].

Nesting : open [Yang et.al, 2007] and close.

IIT Hyderbad MV-OSTMs 35 / 37

Page 62: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

ProgressFuture Work

Garbage Collection.

We will extend it for K-version MV-OSTM.

We will implement our proposed protocol and compare theperformance with existing Object-Based STMs [Hassan et.al, 2014].

Nesting : open [Yang et.al, 2007] and close.

IIT Hyderbad MV-OSTMs 35 / 37

Page 63: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

References

1 Harris, Tim and Marlow, Simon and Peyton-Jones, Simon and Herlihy, Maurice.Composable memory transactions, Proceedings of the tenth ACM SIGPLAN symposiumon Principles and practice of parallel programming, 2005

2 Gerhard Weikum and Gottfried Vossen. 2001. Transactional Information Systems:Theory, Algorithms, and the Practice of Concurrency Control and Recovery. MorganKaufmann Publishers Inc., San Francisco, CA, USA

3 Ziv, Ofri and Aiken, Alex and Golan-Gueta, Guy and Ramalingam, G and Sagiv, Mooly,Composing concurrency control, Proceedings of the 36th ACM SIGPLAN Conference onProgramming Language Design and Implementation, 2015

4 Kuznetsov, Petr and Peri, Sathya, Non-interference and Local Correctness inTransactional Memory, ICDCN, 2014

5 Hassan, Ahmed and Palmieri, Roberto and Ravindran, Binoy, Optimistic TransactionalBoosting, Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practiceof Parallel Programming, PPoPP ’14

6 Priyanka Kumar, Sathya Peri, and K. Vidyasankar. A TimeStamp Based Multi-versionSTM Algorithm. In ICDCN, pages 212–226, 2014

7 Ni, Yang and Menon, Vijay S. and Adl-Tabatabai, Ali-Reza and Hosking, Antony L. andHudson, Richard L. and Moss, J. Eliot B. and Saha, Bratin and Shpeisman, Tatiana,Open Nesting in Software Transactional Memory, PPoPP ’07

IIT Hyderbad MV-OSTMs 36 / 37

Page 64: An Innovative Approach for Achieving …sathya_p/AADDA/AADDA2018 Info...An Innovative Approach for Achieving Composability in Concurrent Systems using Multi-Version Object Based STMs

IIT Hyderbad MV-OSTMs 37 / 37