From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYO9i-0006Zw-3h for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:13:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYO9g-0006ZJ-68 for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:13:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYO9g-0006Z6-0X for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:13:44 -0400 Received: from bsdimp.com ([199.45.160.85] helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYO9f-0005h7-QX for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:13:44 -0400 Date: Sun, 09 Mar 2008 10:12:40 -0600 (MDT) Message-Id: <20080309.101240.1782788363.imp@bsdimp.com> Subject: Re: [Qemu-devel] [PATCH] use a thread id variable From: "M. Warner Losh" In-Reply-To: <47D3F9AF.2030408@codefidence.com> References: <47D3AD53.6030809@codefidence.com> <20080309115826.GA8077@shareable.org> <47D3F9AF.2030408@codefidence.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, gilad@codefidence.com Cc: kvm-devel@lists.sourceforge.net, glommer@gmail.com, chrisw@sous-sol.org, gcosta@redhat.com In message: <47D3F9AF.2030408@codefidence.com> Gilad Ben-Yossef writes: : > What you're supposed to do with pthreads in general is use pthread_self(). : : Unfortunately, AFAIK the opaque handle that pthread_self() returns is : not quite meaningless outside of the process whereas what the non : standard gettid() returns can actually be used to identify a thread from : "outside" the process, like the shell. gettid() is also non-standard. If you want to interact with a thread, you gotta use pthread_self() if you want your code to be portable. Warner