An algorithm of Lock-free extensible hash table Yi Feng.

Slides:



Advertisements
Similar presentations
Dana Shapira Hash Tables
Advertisements

Linked Lists. 2 Merge Sorted Lists Write an algorithm that merges two sorted linked lists The function should return a pointer to a single combined list.
The Dictionary ADT Definition A dictionary is an ordered or unordered list of key-element pairs, where keys are used to locate elements in the list. Example:
Scalable and Lock-Free Concurrent Dictionaries
Dynamic-Sized Nonblocking Hash Tables Yujie Liu Kunlong Zhang Michael Spear Lehigh Univ. Tianjin Univ. Lehigh Univ.
Data Structures: A Pseudocode Approach with C
Data Structures: A Pseudocode Approach with C 1 Chapter 5 Contd... Objectives Explain the design, use, and operation of a linear list Implement a linear.
1 Chapter 3 Arrays, Linked Lists, and Recursion. 2 Static vs. Dynamic Structures A static data structure has a fixed size This meaning is different than.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Introduction to Lock-free Data-structures and algorithms Micah J Best May 14/09.
Computer Laboratory Practical non-blocking data structures Tim Harris Computer Laboratory.
Introduction and a Review of Basic Concepts
Chapter 4 Linked Lists. © 2005 Pearson Addison-Wesley. All rights reserved4-2 Preliminaries Options for implementing an ADT List –Array has a fixed size.
Data Structures Using C++ 2E Chapter 11 Binary Trees and B-Trees.
Recursion CS Goals Discuss recursion as another form of repetition Do the following tasks, given a recursive routine Determine whether the routine.
Data Structures Using C++ 2E
CHAPTER 71 TREE. Binary Tree A binary tree T is a finite set of one or more nodes such that: (a) T is empty or (b) There is a specially designated node.
2 Preliminaries Options for implementing an ADT List Array has a fixed size Data must be shifted during insertions and deletions Linked list is able to.
Identifying Reversible Functions From an ROBDD Adam MacDonald.
C++ Classes and Data Structures Jeffrey S. Childs
Selection Control Structures Simple Program Design Third Edition A Step-by-Step Approach 4.
External data structures
November 15, 2007 A Java Implementation of a Lock- Free Concurrent Priority Queue Bart Verzijlenberg.
1 CSE 326: Data Structures: Hash Tables Lecture 12: Monday, Feb 3, 2003.
CSC 211 Data Structures Lecture 13
Common2 extended to stacks and unbound concurrency By:Yehuda Afek Eli Gafni Adam Morrison May 2007 Presentor: Dima Liahovitsky 1.
“Never doubt that a small group of thoughtful, committed people can change the world. Indeed, it is the only thing that ever has.” – Margaret Meade Thought.
CSS446 Spring 2014 Nan Wang.  To understand the implementation of linked lists and array lists  To analyze the efficiency of fundamental operations.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
A Simple Optimistic skip-list Algorithm Maurice Herlihy Brown University & Sun Microsystems Laboratories Yossi Lev Brown University & Sun Microsystems.
1 Chapter 7 Skip Lists and Hashing Part 2: Hashing.
CS2006- Data Structures I Chapter 5 Linked Lists III.
Chapter 13 C Advanced Implementations of Tables – Hash Tables.
Chapter 9 Hashing Dr. Youssef Harrath
Lecture - 11 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Threaded Trees Binary trees have a lot of wasted space: the leaf nodes each.
Concurrent Hashing and Natural Parallelism Chapter 13 in The Art of Multiprocessor Programming Instructor: Erez Petrank Presented by Tomer Hermelin.
Priority Queues Dan Dvorin Based on ‘The Art of Multiprocessor Programming’, by Herlihy & Shavit, chapter 15.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Chapter 17: Linked Lists. Objectives In this chapter, you will: – Learn about linked lists – Learn the basic properties of linked lists – Explore insertion.
Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects MAGED M. MICHAEL PRESENTED BY NURIT MOSCOVICI ADVANCED TOPICS IN CONCURRENT PROGRAMMING,
Linked list: a list of items (nodes), in which the order of the nodes is determined by the address, called the link, stored in each node C++ Programming:
Chapter 5 Record Storage and Primary File Organizations
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 18: Linked Lists.
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
CC 215 DATA STRUCTURES LINKED LISTS Dr. Manal Helal - Fall 2014 Lecture 3 AASTMT Engineering and Technology College 1.
List Structures What is a list? A homogeneous collection of elements with a linear relationship between the elements linear relationship - each element.
1 Linked List. List vs Arrays Two built-in data structures that can be used to organize data, or to create other data structures: Lists Arrays.
Chapter 16: Linked Lists.
C++ Programming:. Program Design Including
Top 50 Data Structures Interview Questions
Linked Lists & Hash Tables
Data Structure Interview Question and Answers
Review Deleting an Element from a Linked List Deletion involves:
Week 8 - Wednesday CS221.
Datastructure.
Chapter 4 Linked Lists.
Stacks and Queues.
Algorithms and Data Structures
Chapter 4 Linked Lists
Queues.
Chapter 4 Linked Lists.
Multicore programming
Chapter 4 Linked Lists.
Multicore programming
Multicore programming
CS210- Lecture 5 Jun 9, 2005 Agenda Queues
Multicore programming
Multicore programming
General List.
Presentation transcript:

An algorithm of Lock-free extensible hash table Yi Feng

Extensible hash table Let L= 2. Maximum items = L* size. So when we insert 8.

Lock-free extensible hash table Why is hard to implement lock-free extensible hash table ? In single CAS operation, it seems impossible move the items from one linked list and insert it into new bucket. Items may lost.

Solution for Lock-free extensible hash table We will NOT move items among the buckets Move buckets among items.

Split-ordered list: Lock-free extensible hash table We keep all the items in one lock- free linked list. We reverse the bits of the hash key and order the keys by their bit-reversed value. And each bucket gradually has a dummy node that just reverse the bucket number.

How Recursive Split-ordering works We now have a sorted list in which the order is determined by the key’s bit-reversed value.

When extending We want to insert is the bit-reserved value

Data type and private variables

CAS operation CAS(Compare&Swap) is an ATOMIC operation. Input: it takes three arguments: the address of a memory location, an expected value a new value. If the memory location holds the expected value, it is assigned the new value atomically. Output: Boolean return value indicates whether the replacement occurred.

Insert function

Find function

Delete function

Initialization Bucket

Linearizability A history is linearizable if: 1. its invocations and responses can be reordered to yield a sequential history. 2. that sequential history is correct according to the sequential definition of the object. 3. if a response preceded an invoke in the original history, it must still precede it in the sequential reordering. A history is a sequence of invokes and responses made of an object by a set of threads. A sequential history is one in which all invocations have immediate responses.

Linearizability An object is linearizable if all valid histories of its use can be linearized. IT IS HARD TO PROVE. All function calls have a linearization point at some instant between their invoke and response. All functions appear to occur instantly at their linearization point, behaving as specified by the sequential definition. We have an equivalent definition:

Linearizability For insert operation, the linearization point is in line I5, at list_insert operation. That means, if key is in H in line I5, then insert will fails, otherwise it will be inserted and join to set H. For find operation, the linearization point is in line S4, at list_find operation. That means, if key is in H in line S4, then find will return true and otherwise it will return false. For delete operation, the linearization point is in line D4, at list_delete operation. That means, if key in the H in line D4, it will removed and otherwise deletion will fails. Let H be the set of keys beginning with the pointer T[0]

Michael’s lock-free linked list

Insertion function A3 is the linearization point.

Delete function B2 is the linearization point.

Find function Find function guarentees there is a moment *prev is part of list, *prev = and if cur is not null and cur^. = and cur^.Key was the lowest the key value that is greater than or equal to the input key. The linearization point is the lasting reading of cur^ at line D3 by the current thread.

Questions?