From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFC] lin-lwp.c prelim changes for new thread model
Date: Tue, 07 Jan 2003 03:31:00 -0000 [thread overview]
Message-ID: <20030107033133.GB5132@nevyn.them.org> (raw)
In-Reply-To: <3E1A14C5.77F6C2DF@redhat.com>
On Mon, Jan 06, 2003 at 03:44:05PM -0800, Michael Snyder wrote:
> Hi folks,
>
> The up and coming kernel (2.4.20, I believe?) and the next glibc (2.3.1)
> both bring some drastic changes to linux threads. The current gdb thread
> debugging code will not handle them as is.
>
> This is a smallish change that I propose as a preliminary step;
> it'll get things partly working in the new world, without breaking
> them in the old.
>
> Here's the rationalle.
>
> In the old/current model, when one thread gets a signal (such as TRAP),
> we (gdb) have to call kill (SIGSTOP, pid) for every other thread
> (excepting the event thread), and then do a waitpid on each of them.
>
> In the new model, when one thread gets a signal, we only have to
> send kill(SIGSTOP, pid) to _one_ thread, and the kernel will then
> propagate the signal to all of them (_including_ the one that has
> already stopped with eg. SIGTRAP). We must still do a waitpid on
> each and every thread -- however, that now _includes_ the one that
> stopped in the first place (and which we've already done one waitpid on).
>
> I know, you're thinking "wasn't this supposed to get simpler?"
>
> The minimal change I propose below is as follows:
> When we send kill(SIGSTOP) to all the threads, we now include
> the event thread, where previously we had made him a special case.
> That way, whether in the new model or the old one, we can now do
> a waitpid on every thread including the event thread.
>
> What do you think?
To be honest, I don't like this very much. You're hurting performance
in the current case (whose performance is already quite bad enough,
thank you!). I don't think that the additional complexity/waiting is
worthwhile.
If we detect CLONE_THREAD (how do we detect CLONE_THREAD?) we can mark
the new LWP as having a pending stop based on that. Or, Roland has a
kernel patch that's stewing in my mailbox which provides a better way
to handle this entire thing than sending SIGSTOP. I don't think he
ever tested it, and I know I haven't had time, but let me know if you
want a copy.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-01-07 3:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-06 23:44 Michael Snyder
2003-01-07 3:31 ` Daniel Jacobowitz [this message]
2003-01-07 20:39 ` Michael Snyder
2003-01-08 0:34 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030107033133.GB5132@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox