4 Dec
2020
4 Dec
'20
5:44 p.m.
Andrey Semashev wrote:
[*] Incidentally we want to increment with memory order relaxed instead of acq_rel.
This would probably be a good optimization in atomic_count.
atomic_count can't do this because it doesn't have enough knowledge about the context in which it's used. https://github.com/boostorg/smart_ptr/blob/678a544d27d016204c6aed6403b1ffdf0... In principle you can use negative values for the count, again destroying on zero. I could have specified ++a to be relaxed, but it is what it is at this point.