From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26453 invoked by alias); 3 Mar 2008 19:57:30 -0000 Received: (qmail 26443 invoked by uid 22791); 3 Mar 2008 19:57:29 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Mar 2008 19:57:12 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 484723BE92; Mon, 3 Mar 2008 11:57:10 -0800 (PST) Subject: Re: Why does gdb use its own thread ids internally rather than the tid from the underlying thread implementation? From: Michael Snyder To: Martin Fouts Cc: gdb@sourceware.org, Mike Chen In-Reply-To: References: Content-Type: text/plain Date: Mon, 03 Mar 2008 19:57:00 -0000 Message-Id: <1204574228.19253.570.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00026.txt.bz2 On Mon, 2008-03-03 at 10:38 -0800, Martin Fouts wrote: > Hi, > > We're trying to optimize the NetBSD 4.0 implementation of pthreads, > which has an M:N thread implementation, and are having some trouble > getting gdb to work because the underlying thread id for a thread can > change in an M:N implementation. > > Can anyone provide any insight into why gdb doesn't use the underlying > thread id? Sure. I think the main reason is that the underlying thread id is usually something awkward for a user to type (like an 8-digit hex number). GDB supplies a counting number, just like for breakpoints, so that you can type "thread 2" instead of "thread 77af21bc". For another thing, gdb tries to present a more-or-less uniform user interface across platforms. Underlying thread ids are different from one platform to the next. > Or suggestions about how to accommodate M:N without zombie queues? Have you looked at the linux and solaris implementations? They both have M:N thread models.