时间:25-04-26
进程状态
免费影视、动漫、音乐、游戏、小说资源长期稳定更新! 👉 点此立即查看 👈
每一个进程都拥有自己的代码和数据,同时也具备自己的状态。
1、Linux中的进程状态
Linux系统中,进程状态是通过struct task_struct结构体中的各种属性和变量来表示的。在Linux内核的源代码中,进程状态的定义如下:
/* * The task state array is a strange "bitmap" of * reasons to sleep. Thus "running" is zero, and * you can test for combinations of others with * simple bit tests. */ static const char * const task_state_array[] = { "R (running)", /* 0 */ "S (sleeping)", /* 1 */ "D (disk sleep)", /* 2 */ "T (stopped)", /* 4 */ "t (tracing stop)", /* 8 */ "X (dead)", /* 16 */ "Z (zombie)", /* 32 */ };登录后复制