【问题标题】:how to find number of threads in any user process ? any variable in task_struct?如何查找任何用户进程中的线程数? task_struct 中的任何变量?
【发布时间】:2015-02-13 04:07:13
【问题描述】:

在 linux 的 task_struct 中是否有任何成员计算进程中正在运行的总线程数?

我已经读到在 linux 中没有线程,但是如果我们检查任何进程目录 (proc/[PID]/task) 中的任务目录,那么进程的所有线程都有目录

【问题讨论】:

    标签: linux multithreading process


    【解决方案1】:

    /proc/[pid]/stat 文件包含 ps 使用的信息,该信息包括给定进程 pid 的线程数。请查看 proc(5) 的手册页了解更多详细信息。

    【讨论】:

      猜你喜欢
      • 2012-01-17
      • 2021-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多