public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: frysk@sourceware.org
Cc: Tim Moore <timoore@redhat.com>
Subject: Re: [SCM]  master: Avoid spurious waits in CountDownLatch.await
Date: Fri, 23 Nov 2007 09:41:00 -0000	[thread overview]
Message-ID: <1195810857.2981.6.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <20071122205327.10260.qmail@sourceware.org>

Hi Tim,

On Thu, 2007-11-22 at 20:53 +0000, moore@sourceware.org wrote:
>     2007-11-22  Tim Moore  <timoore@redhat.com>
>     
>     	* CountDownLatch.java (await): Loop to avoid spurious wakeup.

Using wait() and notify() are such a pain :{
Good you caught this one.
Using higher order concurrent primitives is good.

There are some other non-guarded wait()s in some of the stepping command
(StepInstructionCommand, StepNextCommand, StepNextiCommand), which all
have something like:

      synchronized (cli.steppingObserver.getMonitor())
        {
          try
            {
              //XXX This looks racy.
              cli.steppingObserver.getMonitor().wait();
            }
          catch (InterruptedException ie) {}
        }

The XXX comment is right :{

If you are cleaning this up anyway you might want to abstract away all
the logic about guarding the mutex into the steppingObserver.

Cheers,

Mark

       reply	other threads:[~2007-11-23  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071122205327.10260.qmail@sourceware.org>
2007-11-23  9:41 ` Mark Wielaard [this message]
2007-11-23 11:15   ` Mark Wielaard

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=1195810857.2981.6.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=frysk@sourceware.org \
    --cc=timoore@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).