SlideShare une entreprise Scribd logo
1  sur  37
Round-Up:
Runtime Checking Quasi Linearizability
of Concurrent Data Structures
Lu Zhang (Virginia Tech)
Arijit Chattopadhyay (Virginia Tech)
Chao Wang (Virginia Tech)
1
Concurrent Data Structures
2
Queues, stacks,… can be parallelized, but should
behave like their sequential counterparts.
Now a de facto
correctness standard
Linearizability: The Definition
3
Linearizability: The Idea
Each method call should “take effect” instantaneously at
some moment between its invocation and its response.
4
4
q.enq(x)
time
q.enq(y)
Linearization Point
Case I: Is this linearizable?
q.enq(x)
q.enq(y)
q.deq(y)
time
q.deq(x)
Yes!
5
q.enq(x) q.enq(y) q.deq(x) q.deq(y)
6
6
q.enq(x) q.deq(y)
time
q.enq(y)
q.deq(x)
Case II: Is this linearizable? No!
Example: Linearizability Violation
temp=count+1;
count=temp;
count = 0;
count =2;
Thread 1: inc()
temp=count+1=1;
count=temp=1;
Thread 2: inc()
temp=count+1=2;
count=temp=2;
A correct execution
Thread 2: inc()
temp=count+1=1;
count=temp=1;
Thread 1: inc()
temp=count+1=1;
count=temp=1;
count = 0;
count =1;
A buggy execution
7
Outline
• Motivation
• What is (quasi) linearizability
• How to check it
• Experiments
• Conclusions
8
Problem: Linearizability can be expensive
• Imposes undue synchronization …
– Performance issues
– Scalability issues
• … that often can be relaxed in many applications
– Scheduler in a task pool
• strict FIFO queue is not required
– Data caching in web
• stale data is acceptable if delay is bounded
– ID generator in distributed systems
• may be out-of-order occasionally
– Shared counter
• Not necessary to be strictly ordered
9
Quasi Linearizability
10
Bounded out-of-order
behaviors
Significant performance
increase
Our Contribution
• First method for checking quasi linearizability in the C/C++
code of concurrent data structure implementations
• Implementation based on
• Clang/LLVM -- for code instrumentation
• Inspect -- a systematic concurrency testing tool
• Detected previously unknown bug
– Scal benchmarks
11
Some Related Work
12
• Theorem Proving
– [V. Vafeiadis VMCAI 2009 ]
… requires significant manual effort
• Model Checking
– [Liu et al FM 2009]
… works only on models, not on the actual source code
implementation
• Runtime Verification
– [S. Burckhardt et al PLDI 2010]
… checks standard linearizability only
Outline
• Motivation
• What is quasi linearizability
• How to check it
• Experiments
• Conclusions
13
Example: Quasi Queue
1. Conceptual Model:
2. Implementation:
14
Quasi Factor=4
Example: Legal Histories
15
Quasi Factor=1
Linearizable
Quasi
Linearizable
Concurrent
Histories
Onion Ring Relationship
16
Linearizable
Histories
Quasi Linearizable
Histories
Our Method
Buggy
Histories
Existing Methods
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
17
3 Verification Levels
In this work, we focus on L1 and L2.
18
Input and Output
• Input
– C/C++ code of the concurrent data structure
– C/C++ code of the test program
– Quasi factor
• Output
– Whether there is a (quasi) linearizability violation
• Debugging info to help understand the violation
19
Overall Workflow
20
Linearizing A Concurrent History
• We compute the linearizations (sequential permutation) by
repeatly untangling the overlapping events
• Overlapping Pattern: … [inv1] … [inv2] … [resp1] …
21
Computing Quasi Permutations
Quasi Queue , k=1
22
Computing Quasi Permutations (alg.)
• Use a doubly linked list to represent the state stack
• Each method call moves object from one state to another
• Use a backtrack exploration to find all quasi permutations
…
deq(3)
deq(1)
23
Quasi Queue , k=1
Newly Enabled Set
• How earlier each method call can occur
24
k=0
k=1
k=2
Restriction 1 Guaranteed!
Lateness Of Method Calls
• How later each method call can occur
• Assign Lateness when enabled
25
Lateness < 0
Lateness = 0
Lateness > 0
k=1
New Enabled:
deq(1), L= 0
deq(2), L= -1
New Enabled:
deq(3), L= -1
New Enabled:
Lateness +1 when not selected
Lateness should always <= quasi factor
Lateness is unique in each state
Backtrack Exploration, K=1
26
Enabled:
deq(1), L=0
deq(2), L= -1
Enabled:
deq(3), L= -1
deq(2), L= -1+1=0
Enabled:
deq(3), L=0
s1 s2 s3
Last backtrack point
Enabled:
deq(1), L=0
deq(2), L= -1
s1 s2
Enabled:
deq(3), L= -1
deq(2), L= -1+1=0
Original
history
s3'
Enabled:
deq(2), L=0+1=1
Last backtrack point
…
…
History: deq(1) deq(2) deq(3)
Must-Select Event
• Lateness should always <= k(quasi factor)
• If the lateness of a method call reaches k, then we
must select it at that state.
• Backtrack Exploration Done!
27
Enabled:
deq(1), L=0
deq(2), L= -1
s1 s2''
Enabled:
deq(3), L= -1
deq(1), L= 0+1=1
L = 1 = k, we must select it !
Restriction 2 Guaranteed!
s3''
Enabled:
deq(3), L= -1+1=0
…
No more backtrack points
Check Quasi Linearizability
28
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
29
Experiments
• The Round-Up tool
– LLVM
– Inspect
• Evaluated on two sets of benchmarks
– Textbook examples
– The Scal benchmarks
30
Results (1)
31
Results (2)
• Results on the Scal benchmark examples
32
The k-stack bug
2
Thread 1:
push(2)
Thread 2:
pop()
2
Empty
Segment!
Push the item
in
Try to remove
Segment
Double check
push: Fail !
Double check
remove: Fail !
Need to retry,
push again
Normal push
…
Normal pop
…
To be removed
2
2
2
33
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
34
Conclusions
• First method for checking quasi
linearizability of C/C++ code of concurrent
data structures
– Fully automated
– Sound, no false positives
• Future work
– Scalability remains a bottleneck
• Add new symmetry reduction techniques and
improve the existing partial order reduction
• Avoid generating redundant quasi permutations
35
Questions?
36
Some Related Work
37
• Theorem Proving
– [V. Vafeiadis VMCAI 2009 ]
– [V. Vafeiadis et al PPOPP 2006]
… requires manual effort
• Model Checking
– [Liu et al FM 2009]
– [M. T. Vechev et al SPIN 2009]
– [P. Cern′y et al CAV 2010]
– [K. Adhikari et al SPIN 2013]
… works on models, not on the actual source code
implementation
• Runtime Verification
– [S. Burckhardt et al PLDI 2010]
– [M. Pradel et al PLDI 2012]
… checks standard linearizability

Contenu connexe

Tendances

Bubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly LanguageBubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly LanguageAriel Tonatiuh Espindola
 
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...Iosif Itkin
 
BEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdfBEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdfShadab Siddiqui
 
Sienna 1 intro
Sienna 1 introSienna 1 intro
Sienna 1 introchidabdu
 
#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction methodSharif Omar Salem
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examplesSharif Omar Salem
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm AnalysisMegha V
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking TutorialAnit Thapaliya
 
Classic Model Checking Algorithms
Classic Model Checking AlgorithmsClassic Model Checking Algorithms
Classic Model Checking Algorithmstyramisu
 
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]AI Robotics KR
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sortingKaushal Shah
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSuresh Pokharel
 

Tendances (17)

Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Bubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly LanguageBubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly Language
 
Algorithms - Aaron Bloomfield
Algorithms - Aaron BloomfieldAlgorithms - Aaron Bloomfield
Algorithms - Aaron Bloomfield
 
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
 
BEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdfBEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdf
 
Sorting
SortingSorting
Sorting
 
Sienna 1 intro
Sienna 1 introSienna 1 intro
Sienna 1 intro
 
#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examples
 
Temporal logic-model-checking
Temporal logic-model-checkingTemporal logic-model-checking
Temporal logic-model-checking
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking Tutorial
 
Classic Model Checking Algorithms
Classic Model Checking AlgorithmsClassic Model Checking Algorithms
Classic Model Checking Algorithms
 
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching Algorithms
 

En vedette

Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01giovtrione
 
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeBad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeOwen Avery
 
membuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdkmembuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdkfetdi sudarto
 
Lean startup - Agicalkväll #58
Lean startup -  Agicalkväll #58Lean startup -  Agicalkväll #58
Lean startup - Agicalkväll #58Bengt Nyman
 

En vedette (7)

Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01
 
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeBad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
 
Ultrasound
UltrasoundUltrasound
Ultrasound
 
membuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdkmembuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdk
 
Storms
StormsStorms
Storms
 
Perkataan bm 4
Perkataan bm 4Perkataan bm 4
Perkataan bm 4
 
Lean startup - Agicalkväll #58
Lean startup -  Agicalkväll #58Lean startup -  Agicalkväll #58
Lean startup - Agicalkväll #58
 

Similaire à Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures

QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28Aritra Sarkar
 
Financial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic ImportanceFinancial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic ImportanceKimmo Soramaki
 
Concurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersConcurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersSubhajit Sahu
 
20100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture0120100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture01Computer Science Club
 
Spacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chainsSpacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chainsDavid Gleich
 
Quarks zk study-club
Quarks zk study-clubQuarks zk study-club
Quarks zk study-clubAlex Pruden
 
Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Guy Korland
 
Dealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDVClub
 
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...Marco Cattani
 
An Introduction to Quantum Programming Languages
An Introduction to Quantum Programming LanguagesAn Introduction to Quantum Programming Languages
An Introduction to Quantum Programming LanguagesDavid Yonge-Mallo
 
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)Israel Buitron
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actorslegendofklang
 
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read JapaneseMachine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read JapaneseMark Lefevre, CQF
 
forecasting model
forecasting modelforecasting model
forecasting modelFEG
 
Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23Aritra Sarkar
 

Similaire à Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures (20)

QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28
 
Financial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic ImportanceFinancial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic Importance
 
Concurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersConcurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papers
 
20100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture0120100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture01
 
Spacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chainsSpacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chains
 
Quarks zk study-club
Quarks zk study-clubQuarks zk study-club
Quarks zk study-club
 
Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.
 
Dealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in Verification
 
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
 
An Introduction to Quantum Programming Languages
An Introduction to Quantum Programming LanguagesAn Introduction to Quantum Programming Languages
An Introduction to Quantum Programming Languages
 
02 analysis
02 analysis02 analysis
02 analysis
 
ARIMA
ARIMA ARIMA
ARIMA
 
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actors
 
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read JapaneseMachine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
 
forecasting model
forecasting modelforecasting model
forecasting model
 
2017 10 17_quantum_program_v2
2017 10 17_quantum_program_v22017 10 17_quantum_program_v2
2017 10 17_quantum_program_v2
 
Analysis
AnalysisAnalysis
Analysis
 
Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23
 
Realtime Analytics
Realtime AnalyticsRealtime Analytics
Realtime Analytics
 

Dernier

Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Dernier (20)

Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures

  • 1. Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures Lu Zhang (Virginia Tech) Arijit Chattopadhyay (Virginia Tech) Chao Wang (Virginia Tech) 1
  • 2. Concurrent Data Structures 2 Queues, stacks,… can be parallelized, but should behave like their sequential counterparts. Now a de facto correctness standard
  • 4. Linearizability: The Idea Each method call should “take effect” instantaneously at some moment between its invocation and its response. 4 4 q.enq(x) time q.enq(y) Linearization Point
  • 5. Case I: Is this linearizable? q.enq(x) q.enq(y) q.deq(y) time q.deq(x) Yes! 5 q.enq(x) q.enq(y) q.deq(x) q.deq(y)
  • 7. Example: Linearizability Violation temp=count+1; count=temp; count = 0; count =2; Thread 1: inc() temp=count+1=1; count=temp=1; Thread 2: inc() temp=count+1=2; count=temp=2; A correct execution Thread 2: inc() temp=count+1=1; count=temp=1; Thread 1: inc() temp=count+1=1; count=temp=1; count = 0; count =1; A buggy execution 7
  • 8. Outline • Motivation • What is (quasi) linearizability • How to check it • Experiments • Conclusions 8
  • 9. Problem: Linearizability can be expensive • Imposes undue synchronization … – Performance issues – Scalability issues • … that often can be relaxed in many applications – Scheduler in a task pool • strict FIFO queue is not required – Data caching in web • stale data is acceptable if delay is bounded – ID generator in distributed systems • may be out-of-order occasionally – Shared counter • Not necessary to be strictly ordered 9
  • 11. Our Contribution • First method for checking quasi linearizability in the C/C++ code of concurrent data structure implementations • Implementation based on • Clang/LLVM -- for code instrumentation • Inspect -- a systematic concurrency testing tool • Detected previously unknown bug – Scal benchmarks 11
  • 12. Some Related Work 12 • Theorem Proving – [V. Vafeiadis VMCAI 2009 ] … requires significant manual effort • Model Checking – [Liu et al FM 2009] … works only on models, not on the actual source code implementation • Runtime Verification – [S. Burckhardt et al PLDI 2010] … checks standard linearizability only
  • 13. Outline • Motivation • What is quasi linearizability • How to check it • Experiments • Conclusions 13
  • 14. Example: Quasi Queue 1. Conceptual Model: 2. Implementation: 14 Quasi Factor=4
  • 15. Example: Legal Histories 15 Quasi Factor=1 Linearizable Quasi Linearizable
  • 16. Concurrent Histories Onion Ring Relationship 16 Linearizable Histories Quasi Linearizable Histories Our Method Buggy Histories Existing Methods
  • 17. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 17
  • 18. 3 Verification Levels In this work, we focus on L1 and L2. 18
  • 19. Input and Output • Input – C/C++ code of the concurrent data structure – C/C++ code of the test program – Quasi factor • Output – Whether there is a (quasi) linearizability violation • Debugging info to help understand the violation 19
  • 21. Linearizing A Concurrent History • We compute the linearizations (sequential permutation) by repeatly untangling the overlapping events • Overlapping Pattern: … [inv1] … [inv2] … [resp1] … 21
  • 23. Computing Quasi Permutations (alg.) • Use a doubly linked list to represent the state stack • Each method call moves object from one state to another • Use a backtrack exploration to find all quasi permutations … deq(3) deq(1) 23 Quasi Queue , k=1
  • 24. Newly Enabled Set • How earlier each method call can occur 24 k=0 k=1 k=2 Restriction 1 Guaranteed!
  • 25. Lateness Of Method Calls • How later each method call can occur • Assign Lateness when enabled 25 Lateness < 0 Lateness = 0 Lateness > 0 k=1 New Enabled: deq(1), L= 0 deq(2), L= -1 New Enabled: deq(3), L= -1 New Enabled: Lateness +1 when not selected Lateness should always <= quasi factor Lateness is unique in each state
  • 26. Backtrack Exploration, K=1 26 Enabled: deq(1), L=0 deq(2), L= -1 Enabled: deq(3), L= -1 deq(2), L= -1+1=0 Enabled: deq(3), L=0 s1 s2 s3 Last backtrack point Enabled: deq(1), L=0 deq(2), L= -1 s1 s2 Enabled: deq(3), L= -1 deq(2), L= -1+1=0 Original history s3' Enabled: deq(2), L=0+1=1 Last backtrack point … … History: deq(1) deq(2) deq(3)
  • 27. Must-Select Event • Lateness should always <= k(quasi factor) • If the lateness of a method call reaches k, then we must select it at that state. • Backtrack Exploration Done! 27 Enabled: deq(1), L=0 deq(2), L= -1 s1 s2'' Enabled: deq(3), L= -1 deq(1), L= 0+1=1 L = 1 = k, we must select it ! Restriction 2 Guaranteed! s3'' Enabled: deq(3), L= -1+1=0 … No more backtrack points
  • 29. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 29
  • 30. Experiments • The Round-Up tool – LLVM – Inspect • Evaluated on two sets of benchmarks – Textbook examples – The Scal benchmarks 30
  • 32. Results (2) • Results on the Scal benchmark examples 32
  • 33. The k-stack bug 2 Thread 1: push(2) Thread 2: pop() 2 Empty Segment! Push the item in Try to remove Segment Double check push: Fail ! Double check remove: Fail ! Need to retry, push again Normal push … Normal pop … To be removed 2 2 2 33
  • 34. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 34
  • 35. Conclusions • First method for checking quasi linearizability of C/C++ code of concurrent data structures – Fully automated – Sound, no false positives • Future work – Scalability remains a bottleneck • Add new symmetry reduction techniques and improve the existing partial order reduction • Avoid generating redundant quasi permutations 35
  • 37. Some Related Work 37 • Theorem Proving – [V. Vafeiadis VMCAI 2009 ] – [V. Vafeiadis et al PPOPP 2006] … requires manual effort • Model Checking – [Liu et al FM 2009] – [M. T. Vechev et al SPIN 2009] – [P. Cern′y et al CAV 2010] – [K. Adhikari et al SPIN 2013] … works on models, not on the actual source code implementation • Runtime Verification – [S. Burckhardt et al PLDI 2010] – [M. Pradel et al PLDI 2012] … checks standard linearizability