Any single-consumer single-producer lock free queue implementation in C?

后端 未结 9 1204
悲哀的现实
悲哀的现实 2020-12-24 04:03

I\'m writing a program with a consumer thread and a producer thread, now it seems queue synchronization is a big overhead in the program, and I looked for some lock free que

9条回答
  •  -上瘾入骨i
    2020-12-24 04:22

    This implementation uses C++'s new and delete which can trivially be ported to the C standard library using malloc and free:

    http://www.drdobbs.com/parallel/writing-lock-free-code-a-corrected-queue/210604448?pgno=2

提交回复
热议问题