Minimize Your Critical Path with Combine-and-Exchange Locks
Simon König, Lukas Epple, Christian Becker
Coroutines正在经历复兴,因为许多现代编程语言支持将合作多任务用于高度并行或异步应用程序。 其中最大的优点之一是并发和同步完全在用户空间中进行管理,从而省略了重重系统调用。 但是,我们发现最先进的用户空间同步原语从内核级调度的角度在用户空间中接近同步。 这在应用程序的关键路径上引入了不必要的延迟,限制了吞吐量。 在本文中,我们重新思考完全在用户空间中安排的任务的同步(例如,coroutines,fibrs等)。 我们开发Combine-and-Exchange调度(CES),这是一种新颖的调度方法,可确保有争议的关键部分保持在同一条执行线程上,而可并行工作在剩余的线程中均匀分布。 我们表明,我们的方法可以应用于许多现有的语言和库,从而在应用程序基准方面提高了3倍的性能,并在微基准上提高了8倍的性能。
Coroutines are experiencing a renaissance as many modern programming languages support the use of cooperative multitasking for highly parallel or asynchronous applications. One of the greatest advantages of this is that concurrency and synchronization is manged entirely in the userspace, omitting heavy-weight system calls. However, we find that state-of-the-art userspace synchronization primitives approach synchronization in the userspace from the perspective of kernel-level scheduling. This int...