Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are no mutexes in any of the major kernels. Mutexes are by definition a userland construct.


> There are no mutexes in any of the major kernels

https://docs.kernel.org/locking/mutex-design.html#when-to-us...

> Unless [specific conditions] ... always prefer [mutexes] to any other locking primitive.


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: