News for hackers. Stuff that matters.
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.
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.
Re:A fast multi-producer, multi-consumer lock-free concurren... by eloff on Monday December 05, 2016 @12:08AM (#13103501)
You wouldn't use this kind of queue on an architecture like that anyway, just use a lock and a regular queue (the lock is not avoidable anyway)