arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1401.6100cs.DCcs.OScs.PFcs.SE
收藏

无锁算法对多核通信API的性能影响

Performance Impact of Lock-Free Algorithms on Multicore Communication APIs

K. Eric Harper, Thijmen de Gooijer

摘要:

通过串行化对共享存储器资源的访问来防止多任务软件应用中的数据竞争条件,从而确保数据一致性和确定性行为。传统上,任务获取和释放锁以同步共享内存上的操作。不幸的是,锁管理可能会增加大量的处理开销,特别是对于多核部署,其中不同核上的任务在队列中等待获取锁。实现多个锁会引入死锁的风险,并使用自旋锁限制任务可以在哪些内核上运行。更好的选择是消除锁并验证是否满足实时属性,这在许多嵌入式应用程序中没有直接考虑。删除锁是不平凡的,为开发人员打包无锁算法可以降低并发缺陷的可能性。本文详细介绍了如何增强多核通信API实现以支持无锁消息传递,以及这对任务之间的数据交换延迟的影响。在Windows和Linux上比较了基于锁和无锁实现的消息、数据包和标量数据交换的吞吐量和延迟。无锁交换模型预测系统架构级别的性能,并为重构提供停止标准。结果表明,从单核到多核硬件架构的迁移降低了基于锁的性能,并提高了无锁性能。

英文摘要:

Data race conditions in multi-tasking software applications are prevented by serializing access to shared memory resources, ensuring data consistency and deterministic behavior. Traditionally tasks acquire and release locks to synchronize operations on shared memory. Unfortunately, lock management can add significant processing overhead especially for multicore deployments where tasks on different cores convoy in queues waiting to acquire a lock. Implementing more than one lock introduces the risk of deadlock and using spinlocks constrains which cores a task can run on. The better alternative is to eliminate locks and validate that real-time properties are met, which is not directly considered in many embedded applications. Removing the locks is non-trivial and packaging lock-free algorithms for developers reduces the possibility of concurrency defects. This paper details how a multicore communication API implementation is enhanced to support lock-free messaging and the impact this has on data exchange latency between tasks. Throughput and latency are compared on Windows and Linux between lock-based and lock-free implementations for data exchange of messages, packets, and scalars. A model of the lock-free exchange predicts performance at the system architecture level and provides a stop criterion for the refactoring. The results show that migration from single to multicore hardware architectures degrades lock-based performance, and increases lock-free performance.

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

↑