From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9061 invoked by alias); 3 Mar 2008 20:56:31 -0000 Received: (qmail 9001 invoked by uid 22791); 3 Mar 2008 20:56:30 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Mar 2008 20:56:06 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1) with ESMTP id m23KtxS4020303; Mon, 3 Mar 2008 21:55:59 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1/Submit) id m23KtxTr022421; Mon, 3 Mar 2008 21:55:59 +0100 (CET) Date: Mon, 03 Mar 2008 20:56:00 -0000 Message-Id: <200803032055.m23KtxTr022421@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: msnyder@specifix.com CC: mfouts@danger.com, gdb@sourceware.org, mchen@danger.com In-reply-to: <1204576678.19253.589.camel@localhost.localdomain> (message from Michael Snyder on Mon, 03 Mar 2008 12:37:58 -0800) Subject: Re: Why does gdb use its own thread ids internally rather than the ?tid from the underlying thread implementation? References: <1204574228.19253.570.camel@localhost.localdomain> <200803032019.m23KJldk019460@brahms.sibelius.xs4all.nl> <1204576678.19253.589.camel@localhost.localdomain> 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/msg00032.txt.bz2 > From: Michael Snyder > Date: Mon, 03 Mar 2008 12:37:58 -0800 > > 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. The code we have in GDB is for the old FreeBSD 4 userlevel threads library, which you could call N:1 threading. As far as I know FreeBSD tried to do both M:N and 1:1 in FreeBSD 5, but I think M:N was more or less abandoned because they couldn't get it to work properly. I'm not sure what the NetBSD folks are up to these days. Given the history of FreeBSD, Linux and Solaris, I'd advise them to stick to 1:1, or at least get that working first before trying M:N. OpenBSD has the beginnings of a 1:1 model, but it is not enabled by default. The official threads library on OpenBSD is based on the same code as the old FreeBSD userlevel threads library (N:1). This one is supported by the same code in GDB.