From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 3 14:51:45 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EE751065705 for ; Thu, 3 Jun 2010 14:51:45 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6878FC0A for ; Thu, 3 Jun 2010 14:51:44 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id o53EphnF020627; Thu, 3 Jun 2010 10:51:43 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Thu, 03 Jun 2010 10:51:43 -0400 (EDT) Date: Thu, 3 Jun 2010 10:51:43 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: =?UTF-8?Q?V=C3=A1clav_Haisman?= In-Reply-To: <6e716c850fa84621482b71826dae55d5@shell.sh.cvut.cz> Message-ID: References: <6e716c850fa84621482b71826dae55d5@shell.sh.cvut.cz> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-1275576703=:28157" Cc: freebsd-hackers@freebsd.org Subject: Re: How to get a thread ID? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 14:51:45 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-851401618-1275576703=:28157 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 3 Jun 2010, V=C3=A1clav Haisman wrote: > > Hi, > is it possible to obtain some sort of a thread ID that identifies a threa= d > within a process other than pthread_self()? Something like gettid() on > Linux? Apparently, on FreeBSD the pthread_t is a pointer type and does no= t > identify the thread well enough. GDB on FreeBSD seems to know about threa= ds > and does not seem to use the same ID as is pthread_t. "identifies a thread" well enough for what? pthread_t is suppose to be opaque. Whether it is an int, pointer, or whatever, it is implementation-defined and not suppose provide any more information than available through the standard pthread interfaces. There are some non-portable interfaces in though. --=20 DE ---559023410-851401618-1275576703=:28157--