Re:A fast multi-producer, multi-consumer lock-free concurren...
by ape4 on Sunday December 04, 2016 @09:03PM
(#13102925)
`atomic` may require a lock, depending on the CPU.
[ Parent
| on HN ]
Re:A fast multi-producer, multi-consumer lock-free concurren...
by DSMan195276 on Sunday December 04, 2016 @09:24PM
(#13102989)
True. In that event though, there's little other options. Locking those variables individually like that is probably worse then other locking options though, so it is worth keeping in mind. but while it would be slower, it would still be just as 'correct' as using actual atomic variables.