本文介绍了内核线程在什么情况下运行在 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

内核线程(与任何用户线程无关,例如:flush 任务)在什么上下文中运行?

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

Linux 内核中除了进程和中断上下文之外还有其他上下文吗?

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-02 02:55