0%

通过 /proc 查看 Linux 线程运行状态

通过 /proc/PID/status 来判断线程运行状态

voluntaryctxtswitches 及 nonvoluntaryctxtswitches 表明了进程/线程 占用/释放了多少次 CPU

另外在 /proc/PID/sched 中 nr_switches 为 nr_voluntary_switches 及 nr_involuntary_switches 之和