- 论坛徽章:
- 0
|
idle线程的用处在ULK3上面第3章有讲解。
After having created the init process, process 0 executes the cpu_idle( ) function, which essentially consists of repeatedly executing the hlt assembly language instruction with the interrupts enabled (see Chapter 4). Process 0 is selected by the scheduler only when there are no other processes in the TASK_RUNNING state.
至于ps中没有显示这个进程,这就要看ps的实现的。在/proc目录下面没有进程0的目录项。另外,在内核中提供了for_each_process宏来遍历所有的进程,但是这个宏却不会对init_task进程,即0号进程进行一些操作。你可以查看一下这个宏。
另外,我想你也可以看看下面这个贴子:
http://linux.chinaunix.net/bbs/viewthread.php?tid=653764### |
|