`
standalone
  • 浏览: 596389 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Lock Free Queue Implementation

阅读更多
One consumer, one producer problem:

Lock Free Queue

Basically add one a separator in a list then nodes between separator and last is owned by consumer, the node between first and separator should be collected by producer and producer only append new nodes to the last.

This problem is also described in the book Java Concurrency in Practice.




见上图,producer从last处插入结点,consumer从divider处开始消耗结点。
  • 大小: 32.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics