public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans Boehm <Hans.Boehm@hp.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gc@napali.hpl.hp.com, Java Patch List <java-patches@gcc.gnu.org>
Subject: Re: External thread suspension (again)
Date: Sun, 04 Jun 2006 04:47:00 -0000	[thread overview]
Message-ID: <Pine.GHP.4.58.0606032136390.6233@tomil.hpl.hp.com> (raw)
In-Reply-To: <4477761B.3060104@redhat.com>

Sorry about the slow resposne.

In general, this also looks like a better approach to me.  Thanks.

Some comments/questions:

1) I don't see where the SUSPENDED flag gets set in response to
GC_suspend_thread.  It gets set in GC_suspend_self(), but I don't
think you get there unless it has already been set?

2) You should probably call GC_brief_async_signal_safe_sleep().
Last time I looked nanosleep wasn't technically async-signal-safe,
but I think select() always has been.

3) Have you thought about the various possible signal races, and which
signals are masked at what point?  I haven't yet had a chance to.  It
may be fine, but if there's an obvious argument that it is, a
comment would be great.

4) IIRC, GC_start_blocking() has a fundamental issue in that there isn't
really a good way to guarantee that all callee-saves registers are visible
onthe stack at the right point.  The result might be very occasional
failures.  So long as this is used only for debugging, and since this
is fixed with an interface change in 7.0, which can be easily accomodated
by your patch, I'd lean towards ignoring this for now.  The more
ambitious, and more correct, solution would be to backport the gc7
do_blocking() code.

Hans

On Fri, 26 May 2006, Keith Seitz wrote:

> Including GC list
>
> -------- Original Message --------
> Subject: Re: [RFC] GC: external thread suspension
> Date: Thu, 25 May 2006 12:39:58 -0700
> From: Keith Seitz <keiths@redhat.com>
> To: Java Patch List <java-patches@gcc.gnu.org>
>
> Okay, since it has been relatively quiet for the past week, I thought I
> would turn this into an official RFA.
>
> I'm going to be conservative, and offer up for approval the patch
> suggested by Hans Boehm, using GC_start/end_blocking. It is much simpler
> than my original patch.
>
> In order to modify gc.h, it looks like I need to ifdef stuff. Since I've
> only done this for pthreads, I've made a best guess as to the proper
> conditions. Let me know if there are any problems with this.
>
> Keith
>
> ChangeLog
> 2006-05-25  Keith Seitz  <keiths@redhat.com>
>
>            * pthread_stop_world.c (GC_suspend_handler): Redirect to
> suspension
>            routine if signal is received and thread is flagged SUSPENDED.
>            (GC_suspend_self): New function.
>            (GC_suspend_thread): New function.
>            (GC_resume_thread): New function.
>            * include/gc.h (GC_suspend_self): Declare.
>            (GC_suspend_thread): Declare.
>            (GC_resumet_thread): Declare.
>            * include/private/pthread_support.h (SUSPENDED): New GC_thread
>            flag.
>
>
>
>

  reply	other threads:[~2006-06-04  4:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-26 21:43 Keith Seitz
2006-06-04  4:47 ` Hans Boehm [this message]
2006-06-05 20:43   ` Keith Seitz
2006-06-09 20:13     ` Bryce McKinlay
2006-06-09 21:10       ` Keith Seitz
2006-06-09 21:24         ` Keith Seitz

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=Pine.GHP.4.58.0606032136390.6233@tomil.hpl.hp.com \
    --to=hans.boehm@hp.com \
    --cc=gc@napali.hpl.hp.com \
    --cc=java-patches@gcc.gnu.org \
    --cc=keiths@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).