信任委托:可扩展、类型和内存安全的锁替代方案

Noaman Ahmad, Ben Baenen, Chen Chen, Jakob Eriksson
{"title":"信任委托:可扩展、类型和内存安全的锁替代方案","authors":"Noaman Ahmad, Ben Baenen, Chen Chen, Jakob Eriksson","doi":"arxiv-2408.11173","DOIUrl":null,"url":null,"abstract":"We present Trust<T>, a general, type- and memory-safe alternative to locking\nin concurrent programs. Instead of synchronizing multi-threaded access to an\nobject of type T with a lock, the programmer may place the object in a\nTrust<T>. The object is then no longer directly accessible. Instead a\ndesignated thread, the object's trustee, is responsible for applying any\nrequested operations to the object, as requested via the Trust<T> API. Locking\nis often said to offer a limited throughput per lock. Trust<T> is based on\ndelegation, a message-passing technique which does not suffer this per-lock\nlimitation. Instead, per-object throughput is limited by the capacity of the\nobject's trustee, which is typically considerably higher. Our evaluation shows\nTrust<T> consistently and considerably outperforming locking where lock\ncontention exists, with up to 22x higher throughput in microbenchmarks, and\n5-9x for a home grown key-value store, as well as memcached, in situations with\nhigh lock contention. Moreover, Trust<T> is competitive with locks even in the\nabsence of lock contention.","PeriodicalId":501291,"journal":{"name":"arXiv - CS - Performance","volume":"5 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Delegation with Trust: A Scalable, Type- and Memory-Safe Alternative to Locks\",\"authors\":\"Noaman Ahmad, Ben Baenen, Chen Chen, Jakob Eriksson\",\"doi\":\"arxiv-2408.11173\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"We present Trust<T>, a general, type- and memory-safe alternative to locking\\nin concurrent programs. Instead of synchronizing multi-threaded access to an\\nobject of type T with a lock, the programmer may place the object in a\\nTrust<T>. The object is then no longer directly accessible. Instead a\\ndesignated thread, the object's trustee, is responsible for applying any\\nrequested operations to the object, as requested via the Trust<T> API. Locking\\nis often said to offer a limited throughput per lock. Trust<T> is based on\\ndelegation, a message-passing technique which does not suffer this per-lock\\nlimitation. Instead, per-object throughput is limited by the capacity of the\\nobject's trustee, which is typically considerably higher. Our evaluation shows\\nTrust<T> consistently and considerably outperforming locking where lock\\ncontention exists, with up to 22x higher throughput in microbenchmarks, and\\n5-9x for a home grown key-value store, as well as memcached, in situations with\\nhigh lock contention. Moreover, Trust<T> is competitive with locks even in the\\nabsence of lock contention.\",\"PeriodicalId\":501291,\"journal\":{\"name\":\"arXiv - CS - Performance\",\"volume\":\"5 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-08-20\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Performance\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2408.11173\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Performance","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.11173","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

我们提出了 "信任"(Trust)这一通用的、类型和内存安全的并发程序锁定替代方案。程序员可以将 T 类型的对象置于信任中,而不是用锁来同步多线程对该对象的访问。这样,对象就不再被直接访问。取而代之的是,指定的线程,即对象的受托人,负责对对象执行任何通过信任 API 请求的操作。锁定通常被认为每锁提供的吞吐量有限。而信任是基于委托的,这是一种消息传递技术,不会受到每个锁的限制。相反,每个对象的吞吐量受限于对象托管人的容量,而托管人的容量通常要高得多。我们的评估结果表明,在存在锁竞争的情况下,信任技术的性能始终大大优于锁定技术,在微基准测试中,信任技术的吞吐量比锁定技术高出 22 倍;在锁竞争严重的情况下,信任技术的吞吐量比自家开发的键值存储和 memcached 高出 5-9 倍。此外,即使在没有锁竞争的情况下,Trust 也能与锁竞争。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Delegation with Trust: A Scalable, Type- and Memory-Safe Alternative to Locks
We present Trust, a general, type- and memory-safe alternative to locking in concurrent programs. Instead of synchronizing multi-threaded access to an object of type T with a lock, the programmer may place the object in a Trust. The object is then no longer directly accessible. Instead a designated thread, the object's trustee, is responsible for applying any requested operations to the object, as requested via the Trust API. Locking is often said to offer a limited throughput per lock. Trust is based on delegation, a message-passing technique which does not suffer this per-lock limitation. Instead, per-object throughput is limited by the capacity of the object's trustee, which is typically considerably higher. Our evaluation shows Trust consistently and considerably outperforming locking where lock contention exists, with up to 22x higher throughput in microbenchmarks, and 5-9x for a home grown key-value store, as well as memcached, in situations with high lock contention. Moreover, Trust is competitive with locks even in the absence of lock contention.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信