public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Andrew Cagney <cagney@redhat.com>
Cc: frysk@sourceware.org, npremji@sourceware.org
Subject: Re: frysk-core/frysk/proc LinuxTask.java TestProcS ...
Date: Thu, 12 Oct 2006 09:17:00 -0000	[thread overview]
Message-ID: <1160644654.3031.57.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <452D7143.6050804@redhat.com>

On Wed, 2006-10-11 at 18:33 -0400, Andrew Cagney wrote:
> Mark Wielaard wrote:
> > Aha. So we are trying to trick our own waitpid() into thinking it
> > received a new SIGCHLD event? But aren't we actually waiting for a
> > SIGSTOP from the child after an ptrace attach?
> >  
> A waitpid doesn not receive a SIGCHLD event, rather the arrival of a 
> waitpid event normally leads to the controlling process being sent a 
> SIGCHLD.

Aha! That explains our PollWaitOnSigChld SignalEvent handler in
LinuxHost. I had never understood this step. Finally all the pieces are
starting to come together and make sense. I always assumed a SIGCHLD was
only send for child terminated events.

Still surprising we have kind of a double bookkeeping here. For each
(traced) child event we get a signal and we have to poll waitpid().
That does sound like high overhead.

> Nurden's patch, which is simple and elegant, fudges the case of SIGCHLD 
> not being sent by sending one anyway.

OK, that just leaves one question:

> > Is sending the signal to our calling Thread as good as sending to any
> > other Thread in our frysk process?

Since we use tkill() on the calling Thread that seems to mean we are
explicitly sending to a particular task and that might not be the one
that has installed the signal handler. So how does that get at the right
place?

BTW. Slightly related, there is a bug/enhancement report for libgcj to
provide signal chaining:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25655
And another one for adding a wait handling hook:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29324
Those might be nice for us, so we can use more of the standard core
library. But I don't believe anybody is working on those atm.

Cheers,

Mark

      reply	other threads:[~2006-10-12  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061011195727.26918.qmail@sourceware.org>
2006-10-11 20:13 ` Mark Wielaard
2006-10-11 20:57   ` Andrew Cagney
2006-10-11 21:26     ` Mark Wielaard
2006-10-11 21:39       ` Nurdin Premji
2006-10-11 22:33       ` Andrew Cagney
2006-10-12  9:17         ` Mark Wielaard [this message]

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=1160644654.3031.57.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=npremji@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).