Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping
A key part of implementing high-level languages is providing built- in and default data structures. Yet selecting good defaults is hard. A mutable data structure’s workload is not known in advance, and it may shift over its lifetime—e.g., between read-heavy and write- heavy, or from heavy contention...
Gespeichert in:
Hauptverfasser: | , , |
---|---|
Format: | Tagungsbericht |
Sprache: | eng |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
container_end_page | 211 |
---|---|
container_issue | 10 |
container_start_page | 197 |
container_title | |
container_volume | 52 |
creator | Chen, Chao-Hong Choudhury, Vikraman Newton, Ryan R. |
description | A key part of implementing high-level languages is providing built- in and default data structures. Yet selecting good defaults is hard. A mutable data structure’s workload is not known in advance, and it may shift over its lifetime—e.g., between read-heavy and write- heavy, or from heavy contention by multiple threads to single- threaded or low-frequency use. One idea is to switch implementa- tions adaptively, but it is nontrivial to switch the implementation of a concurrent data structure at runtime. Performing the transition requires a concurrent snapshot of data structure contents, which normally demands special engineering in the data structure’s de- sign. However, in this paper we identify and formalize an relevant property of lock-free algorithms. Namely, lock-freedom is su cient to guarantee that freezing memory locations in an arbitrary order will result in a valid snapshot. Several functional languages have data structures that freeze and thaw, transitioning between mutable and immutable, such as Haskell vectors and Clojure transients, but these enable only single-threaded writers. We generalize this approach to augment an arbitrary lock-free data structure with the ability to gradually freeze and optionally transition to a new representation. This aug- mentation doesn’t require changing the algorithm or code for the data structure, only replacing its datatype for mutable references with a freezable variant. In this paper, we present an algorithm for lifting plain to adaptive data and prove that the resulting hy- brid data structure is itself lock-free, linearizable, and simulates the original. We also perform an empirical case study in the context of heating up and cooling down concurrent maps. |
doi_str_mv | 10.1145/3156695.3122973 |
format | Conference Proceeding |
fullrecord | <record><control><sourceid>crossref</sourceid><recordid>TN_cdi_crossref_primary_10_1145_3156695_3122973</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>10_1145_3156695_3122973</sourcerecordid><originalsourceid>FETCH-LOGICAL-c171t-666f6f5006ecb912a0a5f63ef70d5c93422d752740bd3b78b5d36971a319d0083</originalsourceid><addsrcrecordid>eNot0D1PwzAUhWELgUQpzKz-Ayn32rGdsFUVUKRKLDBHjn1dQvMl2wXx7wHR6bzTGR7GbhFWiKW6k6i0rtVKohC1kWdsgUpVBaKGc7YAqUWBsoRLdpXSBwBIENWChbW3c-4-ifeTOxQhEnFvs-Upx6PLx0iJdyPf2nSgvr_nlu9ppGh7PlB-nzwPU-RuGt0xRhoz74a5p-G3bO6mkacvO8_duL9mF8H2iW5Ou2Rvjw-vm22xe3l63qx3hUODudBaBx0UgCbX1igsWBW0pGDAK1fLUghvlDAltF62pmqVl7o2aCXWHqCSS3b3_-vilFKk0MyxG2z8bhCaP6bmxNScmOQPCGdbTA</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>conference_proceeding</recordtype></control><display><type>conference_proceeding</type><title>Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping</title><source>ACM Digital Library Complete</source><creator>Chen, Chao-Hong ; Choudhury, Vikraman ; Newton, Ryan R.</creator><creatorcontrib>Chen, Chao-Hong ; Choudhury, Vikraman ; Newton, Ryan R.</creatorcontrib><description>A key part of implementing high-level languages is providing built- in and default data structures. Yet selecting good defaults is hard. A mutable data structure’s workload is not known in advance, and it may shift over its lifetime—e.g., between read-heavy and write- heavy, or from heavy contention by multiple threads to single- threaded or low-frequency use. One idea is to switch implementa- tions adaptively, but it is nontrivial to switch the implementation of a concurrent data structure at runtime. Performing the transition requires a concurrent snapshot of data structure contents, which normally demands special engineering in the data structure’s de- sign. However, in this paper we identify and formalize an relevant property of lock-free algorithms. Namely, lock-freedom is su cient to guarantee that freezing memory locations in an arbitrary order will result in a valid snapshot. Several functional languages have data structures that freeze and thaw, transitioning between mutable and immutable, such as Haskell vectors and Clojure transients, but these enable only single-threaded writers. We generalize this approach to augment an arbitrary lock-free data structure with the ability to gradually freeze and optionally transition to a new representation. This aug- mentation doesn’t require changing the algorithm or code for the data structure, only replacing its datatype for mutable references with a freezable variant. In this paper, we present an algorithm for lifting plain to adaptive data and prove that the resulting hy- brid data structure is itself lock-free, linearizable, and simulates the original. We also perform an empirical case study in the context of heating up and cooling down concurrent maps.</description><identifier>ISSN: 0362-1340</identifier><identifier>EISSN: 1558-1160</identifier><identifier>DOI: 10.1145/3156695.3122973</identifier><language>eng</language><ispartof>SIGPLAN notices, 2017, Vol.52 (10), p.197-211</ispartof><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-c171t-666f6f5006ecb912a0a5f63ef70d5c93422d752740bd3b78b5d36971a319d0083</citedby><cites>FETCH-LOGICAL-c171t-666f6f5006ecb912a0a5f63ef70d5c93422d752740bd3b78b5d36971a319d0083</cites></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>314,780,784,27924,27925</link.rule.ids></links><search><creatorcontrib>Chen, Chao-Hong</creatorcontrib><creatorcontrib>Choudhury, Vikraman</creatorcontrib><creatorcontrib>Newton, Ryan R.</creatorcontrib><title>Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping</title><title>SIGPLAN notices</title><description>A key part of implementing high-level languages is providing built- in and default data structures. Yet selecting good defaults is hard. A mutable data structure’s workload is not known in advance, and it may shift over its lifetime—e.g., between read-heavy and write- heavy, or from heavy contention by multiple threads to single- threaded or low-frequency use. One idea is to switch implementa- tions adaptively, but it is nontrivial to switch the implementation of a concurrent data structure at runtime. Performing the transition requires a concurrent snapshot of data structure contents, which normally demands special engineering in the data structure’s de- sign. However, in this paper we identify and formalize an relevant property of lock-free algorithms. Namely, lock-freedom is su cient to guarantee that freezing memory locations in an arbitrary order will result in a valid snapshot. Several functional languages have data structures that freeze and thaw, transitioning between mutable and immutable, such as Haskell vectors and Clojure transients, but these enable only single-threaded writers. We generalize this approach to augment an arbitrary lock-free data structure with the ability to gradually freeze and optionally transition to a new representation. This aug- mentation doesn’t require changing the algorithm or code for the data structure, only replacing its datatype for mutable references with a freezable variant. In this paper, we present an algorithm for lifting plain to adaptive data and prove that the resulting hy- brid data structure is itself lock-free, linearizable, and simulates the original. We also perform an empirical case study in the context of heating up and cooling down concurrent maps.</description><issn>0362-1340</issn><issn>1558-1160</issn><fulltext>true</fulltext><rsrctype>conference_proceeding</rsrctype><creationdate>2017</creationdate><recordtype>conference_proceeding</recordtype><recordid>eNot0D1PwzAUhWELgUQpzKz-Ayn32rGdsFUVUKRKLDBHjn1dQvMl2wXx7wHR6bzTGR7GbhFWiKW6k6i0rtVKohC1kWdsgUpVBaKGc7YAqUWBsoRLdpXSBwBIENWChbW3c-4-ifeTOxQhEnFvs-Upx6PLx0iJdyPf2nSgvr_nlu9ppGh7PlB-nzwPU-RuGt0xRhoz74a5p-G3bO6mkacvO8_duL9mF8H2iW5Ou2Rvjw-vm22xe3l63qx3hUODudBaBx0UgCbX1igsWBW0pGDAK1fLUghvlDAltF62pmqVl7o2aCXWHqCSS3b3_-vilFKk0MyxG2z8bhCaP6bmxNScmOQPCGdbTA</recordid><startdate>20171031</startdate><enddate>20171031</enddate><creator>Chen, Chao-Hong</creator><creator>Choudhury, Vikraman</creator><creator>Newton, Ryan R.</creator><scope>AAYXX</scope><scope>CITATION</scope></search><sort><creationdate>20171031</creationdate><title>Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping</title><author>Chen, Chao-Hong ; Choudhury, Vikraman ; Newton, Ryan R.</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-c171t-666f6f5006ecb912a0a5f63ef70d5c93422d752740bd3b78b5d36971a319d0083</frbrgroupid><rsrctype>conference_proceedings</rsrctype><prefilter>conference_proceedings</prefilter><language>eng</language><creationdate>2017</creationdate><toplevel>online_resources</toplevel><creatorcontrib>Chen, Chao-Hong</creatorcontrib><creatorcontrib>Choudhury, Vikraman</creatorcontrib><creatorcontrib>Newton, Ryan R.</creatorcontrib><collection>CrossRef</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Chen, Chao-Hong</au><au>Choudhury, Vikraman</au><au>Newton, Ryan R.</au><format>book</format><genre>proceeding</genre><ristype>CONF</ristype><atitle>Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping</atitle><btitle>SIGPLAN notices</btitle><date>2017-10-31</date><risdate>2017</risdate><volume>52</volume><issue>10</issue><spage>197</spage><epage>211</epage><pages>197-211</pages><issn>0362-1340</issn><eissn>1558-1160</eissn><abstract>A key part of implementing high-level languages is providing built- in and default data structures. Yet selecting good defaults is hard. A mutable data structure’s workload is not known in advance, and it may shift over its lifetime—e.g., between read-heavy and write- heavy, or from heavy contention by multiple threads to single- threaded or low-frequency use. One idea is to switch implementa- tions adaptively, but it is nontrivial to switch the implementation of a concurrent data structure at runtime. Performing the transition requires a concurrent snapshot of data structure contents, which normally demands special engineering in the data structure’s de- sign. However, in this paper we identify and formalize an relevant property of lock-free algorithms. Namely, lock-freedom is su cient to guarantee that freezing memory locations in an arbitrary order will result in a valid snapshot. Several functional languages have data structures that freeze and thaw, transitioning between mutable and immutable, such as Haskell vectors and Clojure transients, but these enable only single-threaded writers. We generalize this approach to augment an arbitrary lock-free data structure with the ability to gradually freeze and optionally transition to a new representation. This aug- mentation doesn’t require changing the algorithm or code for the data structure, only replacing its datatype for mutable references with a freezable variant. In this paper, we present an algorithm for lifting plain to adaptive data and prove that the resulting hy- brid data structure is itself lock-free, linearizable, and simulates the original. We also perform an empirical case study in the context of heating up and cooling down concurrent maps.</abstract><doi>10.1145/3156695.3122973</doi><tpages>15</tpages></addata></record> |
fulltext | fulltext |
identifier | ISSN: 0362-1340 |
ispartof | SIGPLAN notices, 2017, Vol.52 (10), p.197-211 |
issn | 0362-1340 1558-1160 |
language | eng |
recordid | cdi_crossref_primary_10_1145_3156695_3122973 |
source | ACM Digital Library Complete |
title | Adaptive lock-free data structures in Haskell: a general method for concurrent implementation swapping |
url | https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-02T15%3A40%3A10IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-crossref&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=proceeding&rft.atitle=Adaptive%20lock-free%20data%20structures%20in%20Haskell:%20a%20general%20method%20for%20concurrent%20implementation%20swapping&rft.btitle=SIGPLAN%20notices&rft.au=Chen,%20Chao-Hong&rft.date=2017-10-31&rft.volume=52&rft.issue=10&rft.spage=197&rft.epage=211&rft.pages=197-211&rft.issn=0362-1340&rft.eissn=1558-1160&rft_id=info:doi/10.1145/3156695.3122973&rft_dat=%3Ccrossref%3E10_1145_3156695_3122973%3C/crossref%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true |