From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 3 08:06:15 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 1EFA71065672 for ; Thu, 3 Jun 2010 08:06:15 +0000 (UTC) (envelope-from v.haisman@sh.cvut.cz) Received: from service2.sh.cvut.cz (ns2.sh.cvut.cz [IPv6:2001:718:2::241]) by mx1.freebsd.org (Postfix) with ESMTP id 982DA8FC24 for ; Thu, 3 Jun 2010 08:06:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by service2.sh.cvut.cz (Postfix) with ESMTP id 6EC6D139A7A; Thu, 3 Jun 2010 10:06:13 +0200 (CEST) Received: from service2.sh.cvut.cz ([127.0.0.1]) by localhost (service2.sh.cvut.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04787-09; Thu, 3 Jun 2010 10:06:12 +0200 (CEST) Received: from shell.sh.cvut.cz (shell.sh.cvut.cz [IPv6:2001:718:2::212]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by service2.sh.cvut.cz (Postfix) with ESMTP id D838F139A6C; Thu, 3 Jun 2010 10:06:11 +0200 (CEST) Received: by shell.sh.cvut.cz (Postfix, from userid 50017) id 9EFD5B839; Thu, 3 Jun 2010 10:06:11 +0200 (CEST) To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Thu, 03 Jun 2010 10:06:11 +0200 From: =?UTF-8?Q?V=C3=A1clav_Haisman?= Message-ID: <6e716c850fa84621482b71826dae55d5@shell.sh.cvut.cz> X-Sender: v.haisman@sh.cvut.cz User-Agent: RoundCube Webmail/0.4-beta X-Spam-Status: No, hits=-3.8 tagged_above=-255.0 required=5.0 tests=ALL_TRUSTED, CRM114_HAM_00 X-Spam-Level: Subject: How to get a thread ID? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 08:06:15 -0000 Hi, is it possible to obtain some sort of a thread ID that identifies a thread within a process other than pthread_self()? Something like gettid() on Linux? Apparently, on FreeBSD the pthread_t is a pointer type and does not identify the thread well enough. GDB on FreeBSD seems to know about threads and does not seem to use the same ID as is pthread_t. -- VH