3 ms·
I'm not entirely sure that I agree with the section comparing mutexes and task dispatch. It appears that the comparison is actually between a spinlock and task
by cyphar 8y ago
I'm not entirely sure that I agree with the section comparing mutexes and task dispatch. It appears that the comparison is actually between a spinlock and task dispatch -- most other kinds of mutexes put a process into an interruptible state that allow the scheduler to run a different process. So I would contend that they act in a very similar fashion in practice. At least, that's how locking works within the Linux kernel (and I think pthreads locks work the same way on Linux).
However, I do quite like this way of thinking about synchronisation. I wonder how many other kinds of synchronisation primitives (I'm thinking about RCU and seqlocks) can be re-thought using this method.