This paper presents a new and practical approach to lock-free locks based on helping, which allows the user to write code using fine-grained locks, but run it in a lock-free manner. Although lock-free locks have been suggested in the past, they are widely viewed as impractical, have some key limitations, and, as far as we know, have never been implemented. The paper presents some key techniques that make lock-free locks practical and more general. The most important technique is an approach to idempotence -- i.e. making code that runs multiple times appear as if it ran once. The idea is based on using a shared log among processes running the same protected code. Importantly, the approach can be library based, requiring very little if any change to standard code -- code just needs to use the idempotent versions of memory operations (load, store, LL/SC, allocation, free). We have implemented a C++ library called Flock based on the ideas. Flock allows lock-based data structures to run in either lock-free or blocking (traditional locks) mode. We implemented a variety of tree and list-based data structures with Flock and compare the performance of the lock-free and blocking modes under a variety of workloads. The lock-free mode is almost as fast as blocking mode under almost all workloads, and significantly faster when threads are oversubscribed (more threads than processors). We also compare with several existing lock-based and lock-free alternatives.


翻译:本文介绍了一种基于帮助的无锁的新的实用方法,它让用户能够使用细细的加成锁来写代码,但以无锁的方式运行。虽然过去曾提出过无锁的锁,但被广泛认为是不切实际的,有一些关键的局限性,而且,据我们所知,从未实施过。本文介绍了一些使无锁的锁切实可行和更加普通的关键技术。最重要的技术是“一罪不二审”的方法,即使代码多次运行的代码显示为“一罪不二审 ” 。这个方法基于的是使用同一受保护的代码的流程之间的共享日志。重要的是,这个方法可以以图书馆为基础,只要对标准代码作任何改动,就几乎是不切实际的,代码只需使用理想的版本的存储操作(load、存储、LL/SC、分配、基于理念的),我们实施了名为“Flock”的C++图书馆。Flock使基于锁的数据结构可以像“一罪不二审”一样运行。我们把基于锁的数据结构与“传统锁”模式一起运行。在“一无锁”或“一罪不二审”模式下,我们用几乎是“一不二审的“一不二审”的“一不休的“一不休的”的“一不休之行”的“一行”模式,我们用“一行”将“一不休之行”将“一行”将“一行”将“一行”的“一行”的“一行的”将“一行”的“一行的”的“一行的”的”将“一行的”将“一行的”的“一行的”模式下“一行的”将“一行的“一行的“一行”将“一行的“一行”模式,在“一行的”将“一行的”将“一行的”模式下“一行”将“一行的”和“一行的“一行的“一行的“一行的“一行的“一行”将“一行的“一行”将“一行”将“一行”将“一行”将“一行”与“一行的“一行的“一行的“一行的“一行的”进行。我们

0
下载
关闭预览

相关内容

专知会员服务
123+阅读 · 2020年9月8日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
161+阅读 · 2020年3月18日
深度强化学习策略梯度教程,53页ppt
专知会员服务
176+阅读 · 2020年2月1日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
ACM MM 2022 Call for Papers
CCF多媒体专委会
5+阅读 · 2022年3月29日
IEEE TII Call For Papers
CCF多媒体专委会
3+阅读 · 2022年3月24日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
Call for Nominations: 2022 Multimedia Prize Paper Award
CCF多媒体专委会
0+阅读 · 2022年2月12日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
ICLR2019最佳论文出炉
专知
11+阅读 · 2019年5月6日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2022年4月19日
On Feature Normalization and Data Augmentation
Arxiv
14+阅读 · 2020年2月25日
Arxiv
13+阅读 · 2019年11月14日
VIP会员
相关VIP内容
专知会员服务
123+阅读 · 2020年9月8日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
161+阅读 · 2020年3月18日
深度强化学习策略梯度教程,53页ppt
专知会员服务
176+阅读 · 2020年2月1日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
相关资讯
ACM MM 2022 Call for Papers
CCF多媒体专委会
5+阅读 · 2022年3月29日
IEEE TII Call For Papers
CCF多媒体专委会
3+阅读 · 2022年3月24日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
Call for Nominations: 2022 Multimedia Prize Paper Award
CCF多媒体专委会
0+阅读 · 2022年2月12日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
ICLR2019最佳论文出炉
专知
11+阅读 · 2019年5月6日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
相关基金
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员