(1)数据结构在多个线程间使用时,需要使用互斥锁来进行同步。
(2)互斥锁有一系列的缺陷
(3)架构CPU支持的汇编指令(CMPXCHG)和系统支持的API(__sync_*和Interlocked*函数),可以将比较和交换操作封装为原子操作(CAS,compare and swap),这是实现无锁数据结构的核心
参考资料:
用于并行计算的多线程数据结构,第 2 部分: 设计不使用互斥锁的并发数据结构
无锁队列的实现
John D. Valois 1994年10月在拉斯维加斯的并行和分布系统系统国际大会上的一篇论文——《Implementing Lock-Free Queues》
分享到:
相关推荐
无锁队列的C实现方法;作为备份;希望对别人有帮助
Implementing Domain-Driven Design 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
implementing the Hands-Free Profile. The most common examples of such devices are in-car Hands-Free units used together with cellular phones, or wearable wireless headsets. The profile defines how ...
Xtext is an open source Eclipse framework for implementing domain-specific languages together with its IDE functionalities. It lets you implement languages really quickly, and, most of all, it covers ...
Implementing Domain-Driven Design
Implementing CIFS - The Common Internet File System,由多个分片 PDF 合成的完整文档,非印刷版。
With Implementing Domain-Driven Design, Vaughn has made an important contribution not only to the literature of the Domain-Driven Design community, but also to the literature of the broader enterprise...
《Implementing CIFS》这本书的完整版,英文的,pdf版
Implementing-a-Database-for-Managing-Access-Control-main.rar
implementing-as400-security.tgz
基于超导量子比特网络的Deutsch-Jozsa算法实现方案,郑小虎,Ming Yang,提出了一个通过电流偏置实现普适逻辑门的改进结构,此改进对实现可扩展的功能强大的量子计算机是必不可少的,目前的技术能制造此
this doc introduces the process of PCIE device hog-plug
Source Code for 2009 Supercomputing Paper Implementing Sparse Matrix-Vector Multiplication on Throughput-Oriented Processors
sappress_implementing_and_configuring_sap_mii
This interface is called Advanced Generic Simulator Interface (AGSI). The AGSI introduces a flexible and easy way for adding new user defined peripherals directly to μVision2. It provides functions ...
Table of Contents PART 1 Getting started with ... Implementing Android-Specific Components And Apis PART 4 Bringing it all together Chapter 1. Building A Star Wars App Using Cross-Platform Components