Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚发现这个:
http://www.emadar.com/fpc/lockfree.htm
乍一看,它看起来不错。有人在用吗?或者也许有人已经看过它并发现它无法使用?
乍一看,它并没有解决ABA问题。
可以在此处找到解决 ABA 问题的类似实现。
如果没问题,那么它只适用于 x86 和 x86_64 处理器,很可能不适用于 PowerPC(可能还有 ARM),因为没有内存屏障指令。
我在生产中用于一个简单的案例,并没有发现任何问题。不过,我在 Delphi 中使用了非通用的。