From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4BA43138010 for ; Sat, 13 Oct 2012 20:30:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE6B821C019; Sat, 13 Oct 2012 20:29:47 +0000 (UTC) Received: from wp260.webpack.hosteurope.de (wp260.webpack.hosteurope.de [80.237.133.29]) by pigeon.gentoo.org (Postfix) with ESMTP id 8103221C019 for ; Sat, 13 Oct 2012 20:28:36 +0000 (UTC) Received: from hsi-kbw-046-005-045-143.hsi8.kabel-badenwuerttemberg.de ([46.5.45.143] helo=gentp); authenticated by wp260.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1TN8K3-0003kx-MN; Sat, 13 Oct 2012 22:28:35 +0200 Date: Sat, 13 Oct 2012 22:28:21 +0200 From: To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Is my system (really) using nptl Message-ID: <20121013222821.08346ce9@gentp> In-Reply-To: <5079CB6B.9040505@taydin.org> References: <50781A2B.3030509@taydin.org> <50794D66.1000305@taydin.org> <2356851.Zlj38iKZWL@energy> <5079CB6B.9040505@taydin.org> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.12; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA512; boundary="Sig_/l.k4qH=AVIQn9jvs8zGbXYl"; protocol="application/pgp-signature" X-bounce-key: webpack.hosteurope.de;lists@aixah.de;1350160116;7ffe764d; X-Archives-Salt: a97ae8ac-1868-4c92-b49d-de2c2a22dcfc X-Archives-Hash: b127e98afd18bd420629cc8fcac898e6 --Sig_/l.k4qH=AVIQn9jvs8zGbXYl Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, 13 Oct 2012 23:13:31 +0300 Timur Aydin wrote: > On 10/13/12 19:15, Canek Pel=E1ez Vald=E9s 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? >=20 > 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. >=20 > 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. >=20 > So, mystery (for me) solved. Thanks for all the replies! >=20 Yes, you got it. When htop claims it's showing PIDs, it's actually lying; in fact it's showing the TIDs (thread ids), and they're different even for multiple threads within the same thread group. (For processes with just a single thread however, TID and PID are equal) Regards, aranea --Sig_/l.k4qH=AVIQn9jvs8zGbXYl Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBCgAGBQJQec7zAAoJEOBVC/zizycOBpAP/0Yyx+O2ONb5PIAIBdqJy482 +smroKnhsU+mzyu9p0pv+o4wW6qwM6OM47sSkrsLZPSdQjnVt7VxtpSSXmjDnWHZ WXmRlve60inXG8Ye0UQnaOC9p8t8GKUntAOejVhlVjh1Fb/g4D7HQsb81elUZO0m rYIiHnBqIwHSFeE4ze3v0n6lKWFrGGmd+ai8i8i0lcZ9FzTTTpeLYfJWP7P48y+E Xr9p6LoBEzrG9tLcaLStx6+BZR1AIGHKXKRhW+5kdVtzzwjXLJ5RhsFACPH1pX7F 5ffbEwTmDamZTJA6zILvk3Lmh6I9A32kIEr/gnofjVoUHZ8n2jyhqeZQT3s42sLH /hw03PbYpA7OgvUufHKD/j4QC37Lk6lsUa7VwdWEbzKxKkqbx7bZ5rxe7Ot4bD/s wuO2BXag36aYQ2jzMrAq1dV4XDe2OXx2YprrtnI04q88cEoPxEOkvXQybSMYXc0h sQwZANgjtNZHOLsNaxglwkuQTkU40VQrfPByf3nqtg/Moyxzmj2Z7O9NRMqDGNYu jswYbDvHjLTpFT8UKF42Sas5SSV9hz5up3tMDOB5YzUxILy6NdKXa6Htp9gt0xA1 yt8YQcZOJhvz7tBXhYVNJyeMJgxL7XytuDpp3iV3fijL2oUlIKagDNhEJYZfiIgv ybVNFpMMszcbQnSVeGcv =Q3ez -----END PGP SIGNATURE----- --Sig_/l.k4qH=AVIQn9jvs8zGbXYl--