This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------------------------------------------- | |
// Atomic singly-linked intrusive list using 128-bits Compare And Swap (AKA: DCAS). | |
// Keeps a version counter with the list head to prevent the A-B-A problem. | |
// | |
// Based on the implementation found in moodycamel.com: | |
// http://moodycamel.com/blog/2014/solving-the-aba-problem-for-lock-free-free-lists | |
// | |
// My implementation uses raw GCC/Clang atomics intrinsics. While in theory | |
// std::atomic of a struct of exactly 16 bytes and properly aligned could |