From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29000 invoked by alias); 3 Mar 2008 20:38:18 -0000 Received: (qmail 28992 invoked by uid 22791); 3 Mar 2008 20:38:17 -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 20:38:00 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 08BCF3BE89; Mon, 3 Mar 2008 12:37:58 -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: Mark Kettenis Cc: mfouts@danger.com, gdb@sourceware.org, mchen@danger.com In-Reply-To: <200803032019.m23KJldk019460@brahms.sibelius.xs4all.nl> References: <1204574228.19253.570.camel@localhost.localdomain> <200803032019.m23KJldk019460@brahms.sibelius.xs4all.nl> Content-Type: text/plain Date: Mon, 03 Mar 2008 20:38:00 -0000 Message-Id: <1204576678.19253.589.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/msg00031.txt.bz2 On Mon, 2008-03-03 at 21:19 +0100, Mark Kettenis wrote: > > From: "Michael Snyder" > > Date: Mon, 03 Mar 2008 11:57:08 -0800 > > > > On Mon, 2008-03-03 at 10:38 -0800, Martin Fouts wrote: [...] > > > 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. > > Linux doesn't. And even Solaris uses a 1:1 model by default nowadays. > And I really doubt the code for M:N ever worked properly in GDB. Really? It was never perfect, but I always thought of M:N on solaris as "mostly working"... > > I'm afraid that implementing GDB support for an M:N threading model is > a largely unsolved problem. > > Given the fact that GDB doesn't even have support for kernel-level > threads (or LWP's) on NetBSD, I'd start with getting that working. > After that, it might be possible by implementing an additional stratum > on top of that, that does the LWP to user-level thread ID translation, > and adds in the threads that are not bound to an LWP. Out of curiosity, how different are the thread models between netbsd and freebsd? I've noticed that there seem to be at least two different models for debugging threads on freebsd, but I'm not up to speed on it.