Concurrent Objects
Concurrent Computation
Objectivism
Objectivism
FIFO Queue: Enqueue Method
FIFO Queue: Dequeue Method
Lock-Based Queue
Lock-Based Queue
A Lock-Based Queue
Lock-Based Queue
A Lock-Based Queue
Lock-Based deq()
Acquire Lock
Implementation: deq()
Check if Non-Empty
Implementation: deq()
Modify the Queue
Implementation: deq()
Implementation: deq()
Release the Lock
Implementation: deq()
Implementation: deq()
Now consider the following implementation
Wait-free 2-Thread Queue
Wait-free 2-Thread Queue
Wait-free 2-Thread Queue
Wait-free 2-Thread Queue
Wait-free 2-Thread Queue
Wait-free 2-Thread Queue
What is a Concurrent Queue?
Correctness and Progress
Sequential Objects
Sequential Specifications
Pre and PostConditions for Dequeue
Pre and PostConditions for Dequeue
Why Sequential Specifications Totally Rock
What About Concurrent Specifications ?
Methods Take Time
Methods Take Time
Methods Take Time
Methods Take Time
Methods Take Time
Sequential vs Concurrent
Concurrent Methods Take Overlapping Time
Concurrent Methods Take Overlapping Time
Concurrent Methods Take Overlapping Time
Concurrent Methods Take Overlapping Time
Sequential vs Concurrent
Sequential vs Concurrent
Sequential vs Concurrent
Sequential vs Concurrent
The Big Question
Intuitively…
Intuitively…
Intuitively
Linearizability
Is it really about the object?
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Read/Write Register Example
Talking About Executions
Formal Model of Executions
Split Method Calls into Two Events
Invocation Notation
Invocation Notation
Invocation Notation
Invocation Notation
Invocation Notation
Response Notation
Response Notation
Response Notation
Response Notation
Response Notation
Response Notation
History - Describing an Execution
Definition
Object Projections
Object Projections
Thread Projections
Thread Projections
Complete Subhistory
Complete Subhistory
Complete Subhistory
Complete Subhistory
Sequential Histories
Sequential Histories
Sequential Histories
Sequential Histories
Sequential Histories
Sequential Histories
Well-Formed Histories
Well-Formed Histories
Well-Formed Histories
Equivalent Histories
Sequential Specifications
Legal Histories
Precedence
Non-Precedence
Notation
Linearizability
Ensuring G S
Remarks
Example
Example
Example
Example
Example
Example
Example
Example
Composability Theorem
Why Does Composability Matter?
Reasoning About Linearizability: Locking
Reasoning About Linearizability: Locking
More Reasoning: Wait-free
More Reasoning: Wait-free
Strategy
Linearizability: Summary
Alternative: Sequential Consistency
Sequential Consistency
Example
Example
Example
Example
Example
Example
Example
Theorem
FIFO Queue Example
FIFO Queue Example
FIFO Queue Example
H|p Sequentially Consistent
H|q Sequentially Consistent
Ordering imposed by p
Ordering imposed by q
Ordering imposed by both
Combining orders
Fact
The Flag Example
The Flag Example
The Flag Example
The Flag Example
Opinion1: It’s Wrong
Opinion2: But It Feels So Right …
Memory Hierarchy
Memory Operations
While Writing to Memory
Revisionist History
Who knew you wanted to synchronize?
Explicit Synchronization
Volatile
Real-World Hardware Memory
Linearizability
Correctness: Linearizability
Progress
Progress Conditions
Progress Conditions
Summary