|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 mytomorrow 于 2020-6-1 14:27 编辑
* S g9 C! E% N8 H: P* U4 t
8 P( V9 A+ h8 n4 B, p1. 内核线程没有地址空间,这通过将mm指针设为NULL来实现。也就是说内核线程是没有用户上下文的进程。' M/ p/ a( v: s7 S! V
, O! A2 Q+ X( F2 ](Kernel threads do not have a process address space and therefore do not have an associated
" W! n5 L7 z3 B6 S% a% k2 Smemory descriptor.Thus, the mm field of a kernel thread’s process descriptor is NULL.; _! }+ F1 v5 M9 S4 x1 g w
This is the definition of a kernel thread—processes that have no user context. )6 s0 G d5 q6 v" p: g7 |& @! H
" I, k7 S5 Q# u& {" ?7 R2. 内核线程只工作在内核空间,不会切换至用户空间运行。但是,内核线程同样是可调度的(schedulable)和可抢占的(preemptable)。/ |% W- T- L" ^* o
8 v8 F7 ~% @3 W6 C; v. V- G
而常规进程在内核态工作,也可以在用户态工作。
3 _. J5 J/ M/ A" p. J H
5 ]) d! x) U" k4 q! ~5 q3. 内核线程只工作在内核态,因此只能访问3GB以上的内存,而常规进程可以访问整个4GB线性地址空间。! Q: B6 M1 [0 r: j! S8 ^# }
( L" X. q \0 T. S/ ~8 p3 x6 s
2 _9 D# ~8 K: N" _ |
|