|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 mytomorrow 于 2020-6-1 14:27 编辑 3 i0 c" x. m2 j* l2 P( @$ W
3 m- @; [2 u9 L1 U* P6 O8 C1 W
1. 内核线程没有地址空间,这通过将mm指针设为NULL来实现。也就是说内核线程是没有用户上下文的进程。( a, l3 i; i2 K4 i8 z! [7 @
/ u5 c/ a* l$ T( |(Kernel threads do not have a process address space and therefore do not have an associated
- J! w' j+ H* b! P5 l2 bmemory descriptor.Thus, the mm field of a kernel thread’s process descriptor is NULL.% [" Q7 m4 n6 L6 I! d# R" |
This is the definition of a kernel thread—processes that have no user context. )2 x! y- a6 E9 F2 R( g! N
9 d+ p6 }* g! c5 J% ?- x* l
2. 内核线程只工作在内核空间,不会切换至用户空间运行。但是,内核线程同样是可调度的(schedulable)和可抢占的(preemptable)。; O+ P9 L8 u2 z/ }9 Y- [- A: k
9 @7 Q7 |) Y6 W4 C1 n4 Y+ L6 |0 a 而常规进程在内核态工作,也可以在用户态工作。7 A( e9 @6 y( W* `4 _: @; Z! T9 L
/ G4 C+ e) I- L
3. 内核线程只工作在内核态,因此只能访问3GB以上的内存,而常规进程可以访问整个4GB线性地址空间。
) e4 b) k6 f0 R2 i$ P
( {7 E& L1 i% |, i; g, g* m, M$ g. C$ T# a4 v8 l' B8 F
|
|