Harnessing epoch-based reclamation for efficient
Author : ellena-manuel | Published Date : 2025-05-12
Description: Harnessing epochbased reclamation for efficient range queries Trevor Brown IST Austria Motivation Lots of data structures offer search insert delete Many real applications eg databases also require range query operations
Presentation Embed Code
Download Presentation
Download
Presentation The PPT/PDF document
"Harnessing epoch-based reclamation for efficient" is the property of its rightful owner.
Permission is granted to download and print the materials on this website for personal, non-commercial use only,
and to display it on your personal computer provided you do not modify the materials and that you retain all
copyright notices contained in the materials. By downloading content from our website, you accept the terms of
this agreement.
Transcript:Harnessing epoch-based reclamation for efficient:
Harnessing epoch-based reclamation for efficient range queries Trevor Brown, IST Austria Motivation Lots of data structures offer search, insert, delete Many real applications (e.g., databases) also require range query operations range-query(lo,hi) returns all keys in [lo, hi) that are in the data structure Requires an instantaneous snapshot Traversing the data structure is not enough 2 Existing support for range queries Specialized data structures Limited supply Ad-hoc techniques – hard to generalize Add range queries to an existing data structure Snap-collector [Petrank and Timnat 2013] Improved for small ranges by [Chatterjee 2016] Read-log-update [MSFM2015] 3 Still high overhead Inefficient: snapshot of the data structure Cannot be used with many data structures Must rewrite all synchronization; High overhead for updates Blocking synchronization (cannot use for lock-free/wait-free) Our goal 4 Non-atomic traversal(lo, hi) Atomic range query(lo, hi) What should traversal guarantee? Traversal(lo, hi) should visit each node that: contains a key in [lo, hi] and is in the data structure at all times during the traversal Many data structures satisfy this with a simple DFS-based traversal procedure (proof in paper) 5 Other requirements Linearizable data structures Each update that changes the data structure is linearized at a write or CAS Programmer should know where they are linearized 6 Effort to use our algorithm In a traversal Invoke TraversalStart Invoke Visit(node) for each node visited Invoke TraversalEnd In an update Invoke UpdateWrite or UpdateCAS at lin. point 7 Algorithm: high-level overview Choose the start of traversal as the snapshot time Ignore newly inserted nodes during the traversal Keep track of nodes deleted during the traversal 2 5 8 12 15 RQ(4,13) 6 I need to ignore 6 I know I missed 12 8 Finding deleted nodes: Epoch-based memory reclamation (EBR) The execution is divided into epochs Threads announce the current epoch before each operation New epoch begins once all threads announce the current one Deleted nodes placed in a per-epoch limbo list Nodes in the limbo list are freed three epochs later After traversing the data structure, traverse the limbo lists! 9 Which nodes should be ignored? Should node be included in the result? When was it: Inserted? Deleted? Include if: inserted before and deleted after or not at all time snapshot time 14 10 Algorithm: when are nodes inserted/deleted? Use a global timestamp TS, incremented at the beginning of a range query Each node has insertion time and deletion time 2 5 8