本文介绍了内核线程在什么情况下可以在Linux中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Linux内核的新手.
我知道有两个上下文
1.进程上下文,在用户空间或内核空间中运行(例如:作为系统调用的一部分)
2.中断上下文

I am newbie to Linux Kernel.
I know that there are two context
1. Process Context, running in user space or in Kernel Space (for ex: as part of System call)
2. Interrupt Context

在什么情况下运行内核线程(与ex:flush任务无关的任何用户线程)?

In what context Kernel Thread (not related to any User Thread, for ex:flush task) runs ?

Linux内核中是否存在除Process和Interrupt上下文之外的其他任何上下文?

Is there any other context other than Process and Interrupt context in Linux Kernel ?

推荐答案

内核线程在内核空间的进程上下文中运行.尽管也有一些内核线程可以处理中断.它们被称为线程中断处理程序.但是它们仍然在流程上下文中运行!

Kernel threads run in process contexts in kernel space. Though there are some kernel threads which handle interrupts too. They are called threaded interrupt handlers. But they still run in process context!

这里很好地解释了这两种环境之间的重要差异!

Here is an excellent explanation of the vital difference between the 2 contexts!

这是可以帮助您获得更多了解的一种!

Here is one which'll help you gain more understanding!

计划程序代码在什么上下文中运行?

据我所知,进程和中断是仅有的两个上下文.

As far as I know, process and interrupt are the only 2 contexts.

这篇关于内核线程在什么情况下可以在Linux中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 02:09