Re:Is Parallel Programming Hard, and, If So, What Can You Do...
by zozbot234 on Monday February 20, 2023 @04:19AM
(#34866481)
Yes, if you can make do with a single atomic-sized object, you can perform any RMW on it with either a CAS loop or a special-cased atomic operation (like add or subtract) and not need any further synchronization. What the GP commenter described as being potentially dangerous and nedding expert knowledge is going in any way beyond that. It's really easy to e.g. trigger ABA problems and other issues without realizing it. So just use a mutex to synchronize access instead.
[ Parent
| on HN ]
There are no comments on this comment yet.