Does a lock-free queue “multiple producers-single consumer” exist for Delphi?

后端 未结 4 1618
一整个雨季
一整个雨季 2021-02-20 01:43

I\'ve found several implementations for single producer-single consumer, but none for multiple producer-single consumer.

Does a lock-free queue for \"multiple producers-

4条回答
  •  死守一世寂寞
    2021-02-20 02:15

    http://svn.berlios.de/svnroot/repos/dzchart/utilities/dzLib/trunk/lockfree/

    @Daniele Teti:

    The reader must wait for all writers who still have access to the old queue to exit the Enqueue method. Since the first thing the reader does in the Dequeue method is providing a new queue for new writers which enter Enqueue it should not take long for all writers that have a reference to the old queue to exit Enqueue. But you are right: It is lock free only for the writers but might still require the reader thread to wait for some writers to exit Enqueue.

提交回复
热议问题