From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>
Subject: Re: [non-stop] 10/10 split user/internal threads
Date: Wed, 02 Jul 2008 03:29:00 -0000 [thread overview]
Message-ID: <200807020428.34396.pedro@codesourcery.com> (raw)
In-Reply-To: <20080701140311.GA30550@caradoc.them.org>
A Tuesday 01 July 2008 15:03:11, Daniel Jacobowitz wrote:
> On Tue, Jul 01, 2008 at 02:37:44PM +0100, Pedro Alves wrote:
> > A Tuesday 01 July 2008 01:51:28, Daniel Jacobowitz wrote:
> > > On Mon, Jun 30, 2008 at 01:08:48AM +0100, Pedro Alves wrote:
> > There's one issue that I'd like to point out. That is, is a
> > thread exits, and it was inferior_ptid, we can't just switch
> > inferior_ptid to null_ptid as I could with split user/internal
> > threads split. A *lot* of things break.
> >
> > The issue arises with the OS quickly reusing ptids:
> >
> > - inferior_ptid (ptid1) exits, we can't delete it from the
> > thread list yet (things break, e.g. context switching...,
> > but many other things break in target code.)
> > - We mark it with THREAD_EXITED, but leave it there.
> > - target notifies new thread with ptid1. There's already
> > such a thread in the list, and it's also the
> > current thread -- inferior_ptid.
> > - To add this new thread to the list, we must get rid
> > of the old exited thread. Conceptually, this new thread
> > although it has the target identifier, it should have a
> > new GDB thread id. So, we could say that in this case,
> > the "non-stop doesn't change threads" premise breaks. But,
> > then again, the user couldn't do anything to the exited
> > thread anyway, and it can only exit is it is running, in which
> > case the user also couldn't do most things with it. Maybe we
> > can just live with this exception.
>
> IMO, as long as GDB is not likely to crash, I don't think there's a
> big problem here. If we, for instance, fail to report one pair of
> thread exit and thread creation events in this case that would be OK.
> Any number of other quirky behaviors would too. Most systems have a
> sufficiently large ID space and avoid immediate reuse such that this
> is very unlikely to ever trigger. If we come across a system that
> reuses the first available TID then we'll have to do better but we'll
> also have an easier way to test :-)
>
Well, quickly was perhaps a too much of a quick word. If the user leaves
the selected thread pointing at an already exited thread, and the
app has many short lived threads, the reusing doesn't have to
be that quick. I'd guess that we may see it happen no so unfrequently
if the target implements thread ids as pointers to (reused) thread
control blocks.
> Is this patch a blocking issue for the other non-stop patches, or
> would you like to start merging them?
I'd like to merge them, yes. But I'd prefer to get the first 7
patches of the series checked in togheter. I need another round of
review on patch 7 (and a mechanical follow up to it).
Patch 8 is going to request attention, and the new version of
patch 10 I'm about to post will need review.
Patches 1-6 and 9, you've already OKed.
> Also, a request: I know that you and Vlad are going to be filling in
> the documentation and test cases before any release goes out with this
> code. In the meanwhile, could you create a wiki page listing things
> to be documented/tested so that there's a single central list?
I've created:
http://sourceware.org/gdb/wiki/GDB_Next_Release
linked from the wiki frontpage. It's short in content, but it should
prevent us from forgeting about it.
--
Pedro Alves
next prev parent reply other threads:[~2008-07-02 3:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-15 21:49 Pedro Alves
2008-06-26 13:41 ` Daniel Jacobowitz
2008-06-30 12:21 ` Pedro Alves
2008-07-01 0:51 ` Daniel Jacobowitz
2008-07-01 13:38 ` Pedro Alves
2008-07-01 14:03 ` Daniel Jacobowitz
2008-07-02 3:29 ` Pedro Alves [this message]
2008-07-02 3:39 ` [non-stop] 10/10 handle exited threads [was: Re: [non-stop] 10/10 split user/internal threads] Pedro Alves
2008-07-07 18:59 ` Daniel Jacobowitz
2008-07-11 11:16 ` Pedro Alves
2008-07-11 11:29 ` Pedro Alves
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=200807020428.34396.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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