On Thu, Dec 26, 2013 at 8:48 PM, Daniel Micay <danielmi...@gmail.com> wrote: > Acquiring and releasing a mutex when there's low contention takes two > atomic operations. Switching to a linked data structure adds far more > overhead than an extra atomic operation. > [...] > A simple array-backed circular buffer has a tiny lock scope, so it > won't ever have high contention. In a less simple case, a mutex will > spin for a bit before falling back to a `futex` system call.
Fair enough, but why do you assume a lock-free queue is a linked data structure? A simple (bounded) array-backed circular buffer can be lock-free too and then there are zero atomic operations. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev