Http://blog.chinaunix.net/uid-22566367-id-3751084.html
http://blog.csdn.net/fly2nn/article/details/6980236
Pstree-p 6762:mysqld Multi-line program, when a request comes, build a thread (12244, 15470) for MySQL login corresponding service thread, other threads unchanged
Pid:[[email of the process protected]~]# Ps-ef | grep mysqld | Grep-v"grep"| Awk'{print $}'6762View all threads of a process
[Email protected] ~]# ps-l 6762
PID LWP TTY STAT time COMMAND
6762 6762 pts/1 sl+ 0:02./mysqld--debug
6762 6763 pts/1 sl+ 0:00./mysqld--debug
6762 6764 pts/1 sl+ 0:00./mysqld--debug
6762 6765 pts/1 sl+ 0:00./mysqld--debug
6762 6766 pts/1 sl+ 0:00./mysqld--debug
6762 6767 pts/1 sl+ 0:00./mysqld--debug
6762 6768 pts/1 sl+ 0:00./mysqld--debug
6762 6769 pts/1 sl+ 0:00./mysqld--debug
6762 6770 pts/1 sl+ 0:00./mysqld--debug
6762 12244 pts/1 sl+ 0:00./mysqld--debug
To view all child processes:
[Email protected] ~]# pstree-p 6762
mysqld (6762) ─┬─{mysqld} (6763)
├─{mysqld} (6764)
├─{mysqld} (6765)
├─{mysqld} (6766)
├─{MYSQLD} (6767)
├─{MYSQLD} (6768)
├─{MYSQLD} (6769)
├─{MYSQLD} (6770)
├─{mysqld} (12244)
~]# cat/proc/12244/statusname: mysqldstate: S (sleeping) Tgid: 6762Pid : 12244PPid: 4383
Mysqld Multithreading with Pstree-p display