|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 mytomorrow 于 2020-6-1 14:27 编辑 - U, n- J( m; f+ Y
! R$ a/ i! z! v( R( A2 r( Z' e. E
1. 内核线程没有地址空间,这通过将mm指针设为NULL来实现。也就是说内核线程是没有用户上下文的进程。9 ~" x4 N8 p7 z) f, S( d
9 B3 H9 _/ c8 C0 [$ \0 k; \5 @8 G0 t9 {
(Kernel threads do not have a process address space and therefore do not have an associated
; L$ [. c$ p7 o; s6 S% N) Smemory descriptor.Thus, the mm field of a kernel thread’s process descriptor is NULL.# q, @4 y$ _# A4 J, D9 k
This is the definition of a kernel thread—processes that have no user context. )( z- x* |* F5 `1 n+ W3 e, u
, ? g5 g! W* Z
2. 内核线程只工作在内核空间,不会切换至用户空间运行。但是,内核线程同样是可调度的(schedulable)和可抢占的(preemptable)。+ C7 `! a* V6 Y/ a8 r7 G
1 `2 i# m" N5 y8 x- k% h3 ?, C
而常规进程在内核态工作,也可以在用户态工作。
. a: c/ b8 O9 ]( v/ B' |
" \ ~* P4 A* r3. 内核线程只工作在内核态,因此只能访问3GB以上的内存,而常规进程可以访问整个4GB线性地址空间。9 Y1 S/ d) w- l) J" h( M' f+ }
& `/ e% Z3 Z; O6 i- V2 O
" A& D9 l# g/ [' `2 R |
|