进程描述符初始化
在linux中,当一个进程启动时,它的进程描述符是如何填充的?我想知道这实际上是在哪里完成的。代码的哪一部分执行初始化(优先级初始化及其调度类等等)。文件名和实际发生的行号会对我有帮助。
sched.h中的prio、ststic_prio和normal_prio变量是如何初始化的?到底是内核代码的哪一部分进行了初始化?
提前致谢。
In linux when a process starts, how is it's process descriptor filled? I would like to know where this is actually done. Which part of the code does the initialization (initialization of priority and it's schedule class and all). File name and the line number where it actually happens would help me.
How is prio, ststic_prio and normal_prio variables in sched.h are initialized? And exactly which part of the kernel code does this initialization??
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你对“开始”的定义是什么?对于fork,请参阅内核源代码中的
kernel/fork.c:copy_process
,对于exec,请参阅fs/exec.c: do_execve
。What is your definition of "start"? For fork, see
kernel/fork.c:copy_process
in the kernel source, for exec, seefs/exec.c:do_execve
.进程描述符位于
init-scripts
中,它位于
/etc/init.d
位置,您可以查看代码,其中包含启动/停止服务的方法,以及启动和停止它们时显示的描述。
Process descriptors are found in
init-scripts
its found in the location
/etc/init.d
you can go through the code, which contains methods for starting/stopping of the service, and description it shows while starting and stopping them.