arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.11173cs.PFcs.OS
收藏

Delegation with Trust<T>: 一种可扩展、类型安全且内存安全的锁替代方案

Delegation with Trust<T>: A Scalable, Type- and Memory-Safe Alternative to Locks

Noaman Ahmad, Ben Baenen, Chen Chen, Jakob Eriksson

AI总结:

提出 Trust<T>,一种基于委托的类型安全锁替代方案,通过指定受托者处理操作,避免每锁吞吐量限制,在锁竞争下性能提升显著,最高达 22 倍,无竞争时亦不逊色。

摘要:

我们提出了 Trust<T>,一种在并发程序中替代锁的通用、类型安全且内存安全的方案。程序员无需使用锁来同步对类型 T 对象的多线程访问,而是可以将对象放入 Trust<T> 中。该对象随后不再直接可访问。相反,一个指定的线程(即该对象的受托者)负责根据 Trust<T> API 的请求,将任何请求的操作应用于该对象。锁通常被认为每个锁的吞吐量有限。Trust<T> 基于委托,这是一种消息传递技术,不会受到这种每锁限制的影响。相反,每个对象的吞吐量受限于该对象受托者的容量,而受托者的容量通常要高得多。我们的评估表明,在存在锁竞争的情况下,Trust<T> 始终且显著地优于锁,在微基准测试中吞吐量最高可提高 22 倍,在高锁竞争的情况下,对于自研键值存储和 memcached,吞吐量可提高 5-9 倍。此外,即使在没有锁竞争的情况下,Trust<T> 也能与锁相媲美。

英文摘要:

We present Trust<T>, 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<T>. 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<T> API. Locking is often said to offer a limited throughput per lock. Trust<T> 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<T> 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<T> is competitive with locks even in the absence of lock contention.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑