Noaman Ahmad, Ben Baenen, Chen Chen, Jakob Eriksson
{"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}
引用次数: 0
Abstract
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.