How do I build a lockless queue?

前端 未结 5 1702
情歌与酒
情歌与酒 2020-12-25 08:41

I\'ve spent today looking into lockless queues. I have a multiple producer, multiple consumer situation. I implemented, for testing, a system using the Interlocked SList t

5条回答
  •  清酒与你
    2020-12-25 09:18

    You might want to take a look at Herb Sutters implementation of a low lock queue.

    http://www.drdobbs.com/hpc-high-performance-computing/211601363

    It does use the c++0x atomics but it would be (should be) easy to implement with your specific architectures atomic ops (__sync_* using GNU, atomic_* on solaris etc).

提交回复
热议问题