From mboxrd@z Thu Jan 1 00:00:00 1970 From: "M. Warner Losh" Subject: Re: [Qemu-devel] [PATCH] use a thread id variable Date: Sun, 09 Mar 2008 10:12:40 -0600 (MDT) Message-ID: <20080309.101240.1782788363.imp@bsdimp.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 Cc: kvm-devel@lists.sourceforge.net, chrisw@sous-sol.org, gcosta@redhat.com To: qemu-devel@nongnu.org, gilad@codefidence.com Return-path: In-Reply-To: <47D3F9AF.2030408@codefidence.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org 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 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/