How do I count the number of running threads (pthreads)?

后端 未结 3 1051
眼角桃花
眼角桃花 2021-01-19 23:46

If I search for counting the number of threads an application has, all the answers involve external programs like top. I want to count the threads within the ap

3条回答
  •  一向
    一向 (楼主)
    2021-01-19 23:49

    Use top -H. But chances are, if you can't read proc, top won't work anyway. If thats the case, there is no easy way and it would depend on your specific system.

提交回复
热议问题