How can I write a lock free structure?

后端 未结 21 1840
忘了有多久
忘了有多久 2020-12-13 12:57

In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solv

21条回答
  •  不思量自难忘°
    2020-12-13 13:50

    Most lock-free algorithms or structures start with some atomic operation, i.e. a change to some memory location that once begun by a thread will be completed before any other thread can perform that same operation. Do you have such an operation in your environment?

    See here for the canonical paper on this subject.

    Also try this wikipedia article article for further ideas and links.

提交回复
热议问题