3 ms·
`atomic` may require a lock, depending on the CPU.
by ape4 10y ago
`atomic` may require a lock, depending on the CPU.
- DSMan195276 10y agoTrue. 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.
- eloff 10y agoYou 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)