문제

How does the linux kernel avoids deadlocks in user processes? Does it have a built-in mechanism that prevents them, or one that recognizes and kills them?

And, is there anything similar for kernel programming?

도움이 되었습니까?

해결책

The kernel does not avoid deadlocks of user-space locks (because often it doesn't even know about them).

Deadlocks of kernel locks are avoided by writing code that is correct. This is greatly helped by lockdep, which can prove the correctness of locking operations.

(The lockdep code has been ported to user space, but it helps only for programs that bother to use it.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top