Hint for Assignment#4: Implementing Lockset-Based Data Race Detector Prof. Moonzoo Kim Computer Science, KAIST CS492B Analysis of Concurrent Programs.

Slides:



Advertisements
Similar presentations
Stacks and Queues. Not really data structures – More of an enforcement of policy – Can be implemented using an array or linked list – Can store just about.
Advertisements

Stack & Queues COP 3502.
CS252: Systems Programming Ninghui Li Program Interview Questions.
0 of 37 Stacks and Queues Lecture of 37 Abstract Data Types To use a method, need to know its essentials: signature and return type o additionally,
CS 206 Introduction to Computer Science II 03 / 04 / 2009 Instructor: Michael Eckmann.
ADT Stacks and Queues. Stack: Logical Level “An ordered group of homogeneous items or elements in which items are added and removed from only one end.”
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO and THOMAS ANDERSON.
Prof. Moonzoo Kim Computer Science, KAIST
Today’s Agenda  Midterm: Nov 3 or 10  Finish Message Passing  Race Analysis Advanced Topics in Software Engineering 1.
CS 263 Course Project1 Survey: Type Systems for Race Detection and Atomicity Feng Zhou, 12/3/2003.
CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
Algorithms and Data Structures Representing Sequences by Arrays and Linked Lists.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Java Collections. Collections, Iterators, Algorithms CollectionsIteratorsAlgorithms.
The Stack and Queue Types Lecture 10 Hartmut Kaiser
ADT Stacks and Queues. Stack: Logical Level “An ordered group of homogeneous items or elements in which items are added and removed from only one end.”
Lists, Stacks, Queues Svetlin Nakov Telerik Corporation
SEG4110 – Advanced Software Design and Reengineering TOPIC G Java Collections Framework.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Stacks and queues Basic operations Implementation of stacks and queues Stack and Queue in java.util Data Structures and Algorithms in Java, Third EditionCh04.
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
Stacks and Queues Introduction to Computing Science and Programming I.
Chapter 15: Advanced Topics: Introducing Data Structures and Recursion Visual Basic.NET Programming: From Problem Analysis to Program Design.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan.
CS 46B: Introduction to Data Structures July 9 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
Some Other Collections: Bags, Sets, Queues and Maps COMP T2 Lecture 4 School of Engineering and Computer Science, Victoria University of Wellington.
Collections. The Plan ● Why use collections? ● What collections are available? ● How are the collections different? ● Examples ● Practice.
Data structures Abstract data types Java classes for Data structures and ADTs.
CSE 501N Fall ‘09 11: Data Structures: Stacks, Queues, and Maps Nick Leidenfrost October 6, 2009.
Lists, Stacks and Queues in C Yang Zhengwei CSCI2100B Data Structures Tutorial 4.
COP INTERMEDIATE JAVA Data Structures. A data structure is a way of organizing a collection of data so that it can be manipulated effectively. A.
Understanding Data Types and Collections Lesson 2.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Stacks And Queues Chapter 18.
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-2.ppt Modification date: March 23, Procedures Essential ingredient of high level.
1 Lecture 14: Queues Lecturer: Santokh Singh CompSci 105 SS 2005 Principles of Computer Science.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
Understanding General Software Development Lesson 3.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
Some Other Collections: Bags, Sets, Queues and Maps COMP T2 Lecture 4 School of Engineering and Computer Science, Victoria University of Wellington.
Data-structure-palooza Checkout DataStructures from SVN.
Computer Engineering Rabie A. Ramadan Lecture 6.
Stacks and Queues CMSC 201. Stacks and Queues Sometimes, when we use a data-structure in a very specific way, we have a special name for it. This is to.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Collections Presented By : Muhammad Atif Hussain Deputy Manager IT (Takaful.
Stacks & Queues CSC 172 SPRING 2002 LECTURE 4 Agenda  Stack  Definition  Implementation  Analysis  Queue  Definition  Implementation  Analysis.
3/3/20161 Stacks and Queues Introduction to Data Structures Ananda Gunawardena.
Understanding General Software Development Lesson 3.
COMP 103 Maps and Queues. RECAP  Iterators (for-each loop)  Bag, Sets, and Stacks - a class, not interface TODAY  Maps and Queues 2 RECAP-TODAY QUICK.
Data Structures Intro2CS – week Stack ADT (Abstract Data Type) A container with 3 basic actions: – push(item) – pop() – is_empty() Semantics: –
1 Data Organization Example 1: A simple text editor –Store the text buffer as a list of lines. –How would we implement the UNDO operation? Example 2: Parsing.
Unit 4 Stacks And Queues King Fahd University of Petroleum & Minerals
G64ADS Advanced Data Structures
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Chapter 12 – Data Structures
QueueStack CS1020.
Chapter 15 Lists Objectives
Stacks and Queues.
Building Java Programs
structures and their relationships." - Linus Torvalds
ITEC 2620M Introduction to Data Structures
Lesson 6. Types Equality and Identity. Collections.
Hint for Assignment#3: Implementing Lockset-Based Data Race Detector
Locking in Java.
Stacks and Queues Prof. Michael Tsai 2017/02/21.
More Data Structures (Part 1)
CS 240 – Advanced Programming Concepts
structures and their relationships." - Linus Torvalds
Chapter 4 Stacks and Queues
Presentation transcript:

Hint for Assignment#4: Implementing Lockset-Based Data Race Detector Prof. Moonzoo Kim Computer Science, KAIST CS492B Analysis of Concurrent Programs

Java Data Structure HashMap – “dictionary” in Java – map.put(key, value) / map.get(key) LinkedList – can be used for stack or queue – Stack (LIFO): push = list.addFirst(x) pop = list.removeFirst() – Queue (FIFO): enqueue = list.addFirst(x) dequeue= list.removeLast() HashSet – do not contain duplicated elements – s1.retainAll(s2): remove s1’s elements that are not in s2 2

Data Structure for Thread HashMap > stacks – Key: thread identifier – Value: a sequence of iids on methodEnter executions – c.f. HashMap is “dictionary” in Java HashMap > heldLocks – Key: thread identifier – Value: a sequence of lock identifiers currently held by this thread – A list is used instead of a set to consider recursive locking 3

Memory Location State Eraser maintains the state for each memory location to check if it is in initialization, and if read-shared. C(v) = {*} C(v) is not updated Initialization Read-shared candidates state firstThread

Data Structure for Memory Address (1/2) HashMap > candidates – Key: memory – Value: a set of candidate locks HashMap state – Key: memory – Value: the monitoring state of the memory 5

Data Structure for Memory Address (2/2) HashMap firstThread – Key: memory – Value: thread that first accesses memory HashMap lastAccessLoc – Key: memory – Value: iid of an operation that access memory right before the data race detection javato.activetesting.analysis.Observer.getIidToLoc(iid) converts iid to the corresponding code line information 6

Lockset Algorithm Example class Account { long balance; //must be non-negative void withdraw(long x){ 1 if(balance >= x){ 2 synchronized(this){ 3 balance=balance – x; 4 } 5 } } void deposit(long x){ 11 synchronized(this){ 12 balance=balance + x; 13 } } 7 11:lock(this) 12:t=balance 12:balance=t+10 t1: deposit(10) Initially, balance : 10 13:unlock(this) 2:lock(this) 3:t=balance t2: withdraw(5) 4:unlock(this) 3:balance=t-5 1:if(balance>=5) lastAccessLoc (balance): 12