Gentoo Archives: gentoo-user

From: Timur Aydin <ta@××××××.org>
To: "Canek Peláez Valdés" <caneko@×××××.com>
Cc: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Is my system (really) using nptl
Date: Sat, 13 Oct 2012 20:15:44
Message-Id: 5079CB6B.9040505@taydin.org
In Reply to: Re: [gentoo-user] Is my system (really) using nptl by "Canek Peláez Valdés"
1 On 10/13/12 19:15, Canek Peláez Valdés wrote:
2 > We can only know seeing the code. Timur, this is the little test I
3 > made which creates 5 threads and runs them for 1 minute. In my case,
4 > `ps x` shows only 1 PID, care to give it a try?
5
6 I have re-read all messages and I noticed Canek writing about the 'ps x'
7 output. I was using htop to watch what's happening. When I used 'ps x',
8 I indeed saw just a single process. Looked around google for the
9 difference between the two, and sure enough, htop by default shows all
10 threads in a process, but ps does not. You have to supply special flags
11 to ps to have it show the threads.
12
13 So I started focusing on the pid's that htop is showing for my simple
14 app's threads. When I try to locate them under /proc/<...>, they don't
15 exist. Further search in google and indeed, the pid's shown for threads
16 aren't really "process id's" in the traditional sense and there is no
17 folder under /proc for them. My app has pid 12397 and one of the threads
18 has pid 12404. To look up the thread pid, one needs to look under
19 /proc/12397/task/12404.
20
21 So, mystery (for me) solved. Thanks for all the replies!
22
23 --
24 Timur

Replies

Subject Author
Re: [gentoo-user] Is my system (really) using nptl lists@×××××.de