3 ms·
That can work well for many programs, but no one has succeeded in writing a multithreaded kernel that way.
by tlb 4y ago
That can work well for many programs, but no one has succeeded in writing a multithreaded kernel that way.
- gpderetta 4y agoI think that DragonflyBSD makes good use of message passing. But sometimes a mutex in the slow path is indeed the easiest solution.
- mgaunard 4y agoThere are no mutexes in any of the major kernels. Mutexes are by definition a userland construct.
- 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.