Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 Linux 内核(android Linux 内核)模块。我有一个一般性问题。是否可以强制内核以非抢占模式运行部分代码?
是的,您可以将代码包装在preempt_disable();/中preempt_enable();。请注意,这不会阻止中断。
preempt_disable();
preempt_enable();