3 ms·
> There are no mutexes in any of the major kernels https://docs.kernel.org/locking/mutex-design.html#when-to-use-mutexes https://docs.kernel.org/locking/mutex-
by preseinger 4y ago
> There are no mutexes in any of the major kernels
https://docs.kernel.org/locking/mutex-design.html#when-to-use-mutexes https://docs.kernel.org/locking/mutex-design.html#when-to-us...
> Unless [specific conditions] ... always prefer [mutexes] to any other locking primitive.
- mgaunard 4y agoI wouldn't call those mutexes myself, but fair enough, I suppose if linux uses this terminology, then that's what people would call it. But this sort of pattern isn't valid everywhere in a kernel. For example things handling interrupts etc wouldn't be able to use it. Also for performance reason you probably don't want to use that for synchronization for anything performance-critical, where you'd try to use something like RCU instead. Probably mostly convenient for initial setup.