3 ms·
> Topics like sequential consistency and memory barriers are critical pieces of the puzzle and can't be overlooked if you want to get the best out of your lock-
by rrss 7y ago
> Topics like sequential consistency and memory barriers are critical pieces of the puzzle and can't be overlooked if you want to get the best out of your lock-free algorithms. I will cover them all in the next episode.
Not every article has to be an exhaustive description of everything you need to know.
Anywho, sequential consistency is the default for C++11 and C11 atomics, so you pretty much can use them without a complete understanding of memory consistency models.
- dragontamer 7y agoAh, you're right. They call them "barriers" instead of "fences", so I didn't pick up on that paragraph. Still, C11 and C++ atomics aren't widely implemented yet in the GPU world. OpenCL 1.2 doesn't have them (and OpenCL 2.0 is not commonly implemented), CUDA doesn't have them yet, AMD ROCm doesn't have them yet. And anyone with older compilers will probably be working with fence intrinsics, instead of "innate" barriers per atomic instruction.
- deleted 7y ago[deleted]