Why do I see one more thread than the number I created in my `ps` listing?

后端 未结 3 874
我在风中等你
我在风中等你 2021-01-19 05:27

When I create a thread (pthread_create()) from my main process, I see three (3) threads in the ps listing, why is this? That is, I see the process

3条回答
  •  轮回少年
    2021-01-19 05:55

    It is likely the "thread manager" thread. See answer D.5 at this link.

    You won't see the extra process listed on most modern Linux systems if they are using NPTL. But I searched and it sounds like BusyBox uses ulibc which I think only added NPTL support recently. So I don't know for sure, but my guess is you are using LinuxThreads and seeing the manager thread as the extra thread.

提交回复
热议问题