Linux application development notes: monitor the status of multi-threads in the process, the thread gets its own PID

Terminal monitoring thread information

ps -aux | grep process name

pstree -p process PID

top -Hp process PID

Thread gets its own PID

#define _D_GNU_SOURCE

#include <unistd.h>

#include <sys/syscall.h>

syscall(SYS_gettid)

Guess you like

Origin blog.csdn.net/u010018991/article/details/109204525