Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: msnyder@specifix.com
Cc: drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: [non-stop] 08/10 linux native support
Date: Wed, 09 Jul 2008 07:56:00 -0000	[thread overview]
Message-ID: <200807090626.m696QIcD010586@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <1215573936.3549.126.camel@localhost.localdomain> (message from 	Michael Snyder on Tue, 08 Jul 2008 20:25:36 -0700)

> From: Michael Snyder <msnyder@specifix.com>
> Date: Tue, 08 Jul 2008 20:25:36 -0700
> 
> On Mon, 2008-07-07 at 14:20 -0400, Daniel Jacobowitz wrote:
> > On Wed, Jul 02, 2008 at 04:34:50AM +0100, Pedro Alves wrote:
> > > @@ -337,7 +337,9 @@ linux_fork_killall (void)
> > >      {
> > >        pid = PIDGET (fp->ptid);
> > >        do {
> > > -	ptrace (PT_KILL, pid, 0, 0);
> > > +	/* Use SIGKILL instead of PTRACE_KILL because the former works even
> > > +	   if the thread is running, while the later doesn't.  */
> > > +	kill (pid, SIGKILL);
> > >  	ret = waitpid (pid, &status, 0);
> > >  	/* We might get a SIGCHLD instead of an exit status.  This is
> > >  	 aggravated by the first kill above - a child has just
> > 
> > This is OK but if anyone wants to make fork support handle
> > multi-threaded programs someday we may need to expose kill_lwp.
> 
> Fork is undefined in a multi-threaded program.

No it's not.  It's supposed to fork only the running thread, that is,
you get a copy of the vm space withe a single thread in it whose
initial state is a copy of the state of the thread executing fork.

Some OS'es offer an alternative fork that forks all running threads
but it is non-standard.


  parent reply	other threads:[~2008-07-09  7:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 21:10 Pedro Alves
2008-06-25 21:17 ` Daniel Jacobowitz
2008-06-25 22:03   ` Pedro Alves
2008-06-25 22:12     ` Pedro Alves
2008-06-25 22:52       ` Daniel Jacobowitz
2008-06-25 23:08     ` Daniel Jacobowitz
2008-07-02  3:35       ` Pedro Alves
2008-07-07 18:20         ` Daniel Jacobowitz
2008-07-09  3:25           ` Michael Snyder
2008-07-09  3:47             ` Daniel Jacobowitz
2008-07-09  3:55               ` Michael Snyder
2008-07-09  7:55                 ` Mark Kettenis
2008-07-09  7:56             ` Mark Kettenis [this message]
2008-07-10 15:28           ` Pedro Alves
2008-07-10 17:15             ` Daniel Jacobowitz
2008-07-10 18:01               ` Pedro Alves
2008-07-10 19:59                 ` Daniel Jacobowitz
2008-07-10 21:51                   ` Pedro Alves
2008-07-10 22:15                     ` Daniel Jacobowitz
2008-07-10 23:01                       ` 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=200807090626.m696QIcD010586@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@specifix.com \
    --cc=pedro@codesourcery.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