On 10/13/12 19:15, Canek Peláez Valdés wrote: > We can only know seeing the code. Timur, this is the little test I > made which creates 5 threads and runs them for 1 minute. In my case, > `ps x` shows only 1 PID, care to give it a try?
I have re-read all messages and I noticed Canek writing about the 'ps x' output. I was using htop to watch what's happening. When I used 'ps x', I indeed saw just a single process. Looked around google for the difference between the two, and sure enough, htop by default shows all threads in a process, but ps does not. You have to supply special flags to ps to have it show the threads. So I started focusing on the pid's that htop is showing for my simple app's threads. When I try to locate them under /proc/<...>, they don't exist. Further search in google and indeed, the pid's shown for threads aren't really "process id's" in the traditional sense and there is no folder under /proc for them. My app has pid 12397 and one of the threads has pid 12404. To look up the thread pid, one needs to look under /proc/12397/task/12404. So, mystery (for me) solved. Thanks for all the replies! -- Timur