1 Martin Vechev IBM T.J. Watson Research Center Joint work with: Hagit Attiya, Rachid Guerraoui, Danny Hendler, Petr Kuznetsov, Maged Michael.

Slides:



Advertisements
Similar presentations
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Advertisements

Inherent limitations facilitate design and verification of concurrent programs Hagit Attiya Technion.
IBM T. J. Watson Research Center Conditions for Strong Synchronization Maged Michael IBM T J Watson Research Center Joint work with: Martin Vechev, Hagit.
Operating Systems Part III: Process Management (Process Synchronization)
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Architecture-aware Analysis of Concurrent Software Rajeev Alur University of Pennsylvania Amir Pnueli Memorial Symposium New York University, May 2010.
CS 162 Memory Consistency Models. Memory operations are reordered to improve performance Hardware (e.g., store buffer, reorder buffer) Compiler (e.g.,
“FENDER” AUTOMATIC MEMORY FENCE INFERENCE Presented by Michael Kuperstein, Technion Joint work with Martin Vechev and Eran Yahav, IBM Research 1.
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
Chapter 6 Process Synchronization Bernard Chen Spring 2007.
Chapter 6: Process Synchronization
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Process Synchronization. Module 6: Process Synchronization Background The Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores.
PARTIAL-COHERENCE ABSTRACTIONS FOR RELAXED MEMORY MODELS Presented by Michael Kuperstein, Technion Joint work with Martin Vechev, IBM Research and Eran.
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Inherent limitations on DAP TMs 1 Inherent Limitations on Disjoint-Access Parallel Transactional Memory Hagit Attiya, Eshcar Hillel, Alessia Milani Technion.
Inherent limitations facilitate design & verification of concurrent programs Hagit Attiya Technion.
Martin Vechev IBM Research Michael Kuperstein Technion Eran Yahav Technion (FMCAD’10, PLDI’11) 1.
Lock-free Cache-friendly Software Queue for Decoupled Software Pipelining Student: Chen Wen-Ren Advisor: Wuu Yang 學生 : 陳韋任 指導教授 : 楊武 Abstract Multicore.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
COLT: Effective Testing of Concurrent Collection Usage Alex Aiken Nathan Bronson Stanford University Martin Vechev Eran Yahav IBM Research Mooly Sagiv.
Deriving Linearizable Fine-Grained Concurrent Objects Martin Vechev Eran Yahav IBM T. J. Watson Research Center Martin Vechev Eran Yahav IBM T. J. Watson.
1 Sharing Objects – Ch. 3 Visibility What is the source of the issue? Volatile Dekker’s algorithm Publication and Escape Thread Confinement Immutability.
02/17/2010CSCI 315 Operating Systems Design1 Process Synchronization Notice: The slides for this lecture have been largely based on those accompanying.
Synchronization (other solutions …). Announcements Assignment 2 is graded Project 1 is due today.
Comparison Under Abstraction for Verifying Linearizability Daphna Amit Noam Rinetzky Mooly Sagiv Tom RepsEran Yahav Tel Aviv UniversityUniversity of Wisconsin.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Process Synchronization.
02/19/2007CSCI 315 Operating Systems Design1 Process Synchronization Notice: The slides for this lecture have been largely based on those accompanying.
Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Who’s Afraid of a Big Bad Lock Nir Shavit Sun Labs at Oracle Joint work with Danny.
SUPPORTING LOCK-FREE COMPOSITION OF CONCURRENT DATA OBJECTS Daniel Cederman and Philippas Tsigas.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Maria-Cristina Marinescu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology A Synthesis Algorithm for Modular Design of.
Compositional Verification of Termination-Preserving Refinement of Concurrent Programs Hongjin Liang Univ. of Science and Technology of China (USTC) Joint.
Testing and Verifying Atomicity of Composed Concurrent Operations Ohad Shacham Tel Aviv University Nathan Bronson Stanford University Alex Aiken Stanford.
Shared Memory Consistency Models: A Tutorial Sarita V. Adve Kouroush Ghrachorloo Western Research Laboratory September 1995.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
Martin Vechev Eran Yahav Greta Yorsh IBM T.J. Watson Research Center.
Challenges in Non-Blocking Synchronization Håkan Sundell, Ph.D. Guest seminar at Department of Computer Science, University of Tromsö, Norway, 8 Dec 2005.
L AWS OF ORDER : EXPENSIVE SYNCHRONIZATION IN CONCURRENT ALGORITHMS CANNOT BE ELIMINATED POPL '11 Hagit Attiya, Rachid Guerraoui, Danny Hendler, Petr Kuznetsov,
Eran Yahav 1. Previously…  An algorithmic view  Abstract data types (ADT)  Correctness Conditions  Sequential consistency  Linearizability  Treiber’s.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
Fence Scoping Changhui Lin †, Vijay Nagarajan*, Rajiv Gupta † † University of California, Riverside * University of Edinburgh.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
Efficient Fork-Linearizable Access to Untrusted Shared Memory Presented by: Alex Shraer (Technion) IBM Zurich Research Laboratory Christian Cachin IBM.
PARALLEL RECURSIVE STATE COMPRESSION FOR FREE ALFONS LAARMAN JOINT WORK WITH: MICHAEL WEBER JACO VAN DE POL 12/7/2011 SPIN 2011.
Fence Complexity in Concurrent Algorithms Petr Kuznetsov TU Berlin/DT-Labs.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Practical concurrent algorithms Mihai Letia Concurrent Algorithms 2012 Distributed Programming Laboratory Slides by Aleksandar Dragojevic.
O(log n / log log n) RMRs Randomized Mutual Exclusion Danny Hendler Philipp Woelfel PODC 2009 Ben-Gurion University University of Calgary.
Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
A Calculus of Atomic Actions Tayfun Elmas, Shaz Qadeer and Serdar Tasiran POPL ‘ – Seminar in Distributed Algorithms Cynthia Disenfeld 27/05/2013.
An algorithm of Lock-free extensible hash table Yi Feng.
Scalable lock-free Stack Algorithm Wael Yehia York University February 8, 2010.
Simplifying Linearizability Proofs Using Reduction and Abstraction Serdar Tasiran Koc University, Istanbul, Turkey Tayfun Elmas, Ali Sezgin, Omer Subasi.
Writing, Verifying and Exploiting Formal Specifications for Hardware Designs Chapter 3: Verifying a Specification Presenter: Scott Crosby.
Challenges in Concurrent Computing
Practical Non-blocking Unordered Lists
Threads and Memory Models Hal Perkins Autumn 2011
Threads and Memory Models Hal Perkins Autumn 2009
Multicore programming
Multicore programming
Sitting on a Fence: Complexity Implications of Memory Reordering
CSE 153 Design of Operating Systems Winter 19
Problems with Locks Andrew Whitaker CSE451.
Presentation transcript:

1 Martin Vechev IBM T.J. Watson Research Center Joint work with: Hagit Attiya, Rachid Guerraoui, Danny Hendler, Petr Kuznetsov, Maged Michael

Concurrency 2 …is about synchronization

Synchronization 3 but how much ?

Synchronization 4 we don’t know

Synchronization 5 manual empirical process

Synchronization 6 time consuming

Synchronization 7 too much is inefficient

Synchronization 8 too little is incorrect

Example: Set ADT 9 bool add(int key) { ??? } bool remove(int key) { ??? } bool contains(int key) { ??? }

Our Result 10 Concurrent abstract data types (stacks, queues, sets, hash tables, counters …) and mutual exclusion algorithms must use expensive synchronization

Implications 11 concurrent programming: guidance on when avoiding expensive synchronization is futile

12 “…although I hope that these shortcomings will be addressed, I hasten to add that they are insignificant compared to the huge step forward that this paper represents….” -- Linux Weekly News, Jan 26, Implications

13 hardware design: motivation to lower cost of specific synchronization

Implications 14 API design: API specification affects synchronization

Implications 15 program verification: - declare incorrect when synchronization is missing - simplify verification under weak memory models

What expensive synchronization? 16 order: read-after-write

17... write X read Y... read Y write X modern architectures/languages Read-after write reordering... write X fence read Y Fence: enforce order Example: Read-after-Write

What expensive synchronization? 18 atomicity: atomic write-after-read

Atomic Write-after-Read... read X write Y... read X write X... Examples: compare-and-swap fetch-and-add read-modify-write

Which abstract data types ? 20 Atomicity Determinism Commutativity

Example: Set ADT 21 bool add(v) add v bool remove(v) remove v bool contains(v) check if v is in the set

22 Example: Set ADT Example Histories: add(5): true; remove(5): true; … add(5): true; add(5): false; … add(5): true; contains(5): true; …

23 specification of Set is deterministic Example: Set ADT

24 commutativity: a way to select methods

25 select non-commutative methods

26 method A is non-commutative if there exists another method B where: A influences B and B influences A

27 bool add(v) is non-commutative: Example: Set ADT add(v) influences add(v)

28 Example: Set ADT {} add(5): true; add(5): false; (add influences add)

29 bool remove (v) is non-commutative: Example: Set ADT remove (v) influences remove(v)

30 bool contains(v) is commutative: Example: Set ADT contains(v) does not influence add(v), remove(v) or contains(v)

31 How about void add(v) ? void add(v) is commutative Example: Set ADT nobody can influence void add(v)

32 Atomicity Determinism Commutativity Which abstract data types ?

33 Linearizability Determinism Commutativity Which abstract data types ?

34 Linearizability: when a concurrent implementation is equivalent to a sequential specification [Herlihy&Wing – TOPLAS’90] [Filipovic et. al – ESOP 2009]

Theorem 35 given: deterministic sequential specification, non-commutative method M then: any linearizable implementation of spec contains sequential executions of M that use RAW or AWAR

36 bool add(int key) { ??? } bool remove(int key) { ??? } bool contains(int key) { ??? } Example: Set ADT

37 Set specification is deterministic bool remove(v) is non-commutative Any linearizable implementation of remove (v) must have sequential executions with RAW or AWAR Example: Set ADT

38 bool add(int key) { ??? } bool remove(int key) { RAW or AWAR } bool contains(int key) { ??? } Example: Set ADT

39 Set specification is deterministic bool contains(v) is commutative cannot say anything about contains(v) Example: Set ADT

40 bool add(int key) { ??? } bool remove(int key) { RAW or AWAR } bool contains(int key) { ??? } Example: Set ADT

41 Set specification is deterministic bool add(v) is non-commutative Any linearizable implementation of add(v) must have sequential executions with RAW or AWAR Example: Set ADT

42 bool add(int key) { RAW or AWAR } bool remove(int key) { RAW or AWAR } bool contains(int key) { ??? } Example: Set ADT

43 Proof Intuition: Writing show a method must write otherwise, it cannot influence anyone hence, method would be commutative

44 {} Proof Intuition: Writing add(5)true {} no shared write add(5)true add(5) did not influence add(5)

45 Proof Intuition: Reading show a method must read otherwise, it cannot be influenced by anyone hence, method would be commutative

46 Proof Intuition: RAW {} add(5) true add(5) true W no RAW add(5)true add(5) Linearization {}

47 Summary Atomicity (Linearizability) Determinism Commutativity RAW AWAR

48 Future Directions Even when laws have been written down, they ought not always to remain unaltered -- Aristotle

49 Future Directions Algorithm Specialization: Relax dimensions to obtain new algorithms

50 Future Directions Can the dimensions be weakened? (while keeping lower bound) Sequential Consistency ? Weaker Commutativity ? Abstract Determinism ?

51 Future Directions Can the result by strengthened ? write-write read-read sequences of reads and writes composite operations more (all) executions

The End 52