title: How to get pid from pthread
body: <p>in RH Linux, every pthread is mapping to a pid, which can be monitored in tools such as htop. but how can i get the pid of a thread? getpid() just return the pid of the main thread.</p>