Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: Andrew Cagney <ac131313@ges.redhat.com>
Cc: Momchil Velikov <velco@fadata.bg>, gdb-patches@sources.redhat.com
Subject: Re: RDI code busy-waiting on running target?
Date: Mon, 15 Jul 2002 00:28:00 -0000	[thread overview]
Message-ID: <20020714225500.A1054@grante.dsl.visi.com> (raw)
In-Reply-To: <3D31BC77.5020700@ges.redhat.com>; from ac131313@ges.redhat.com on Sun, Jul 14, 2002 at 02:01:27PM -0400

On Sun, Jul 14, 2002 at 02:01:27PM -0400, Andrew Cagney wrote:
> > "Andrew" == Andrew Cagney <ac131313@ges.redhat.com> writes:

> >>> +    struct timeval timeout;
> >>> +    timeout.tv_sec = 0;
> >>> +    timeout.tv_usec = 10000;
> >>> +
> >>> +    select(0,0,0,0,&timeout);
> > 
> > Andrew> Doing a select on nothing strikes me as wrong.  How is this code
> > Andrew> detecting that something is ``ready''?

It has no way of knowing.  That's the whole problem.  There is
no way: it's a busy-wait polling loop.

> > Timeout.  AFAIK, the only option for high-resolution sleep in systems
> > lacking ``nanosleep''.
> 
> If it is a timeout, it should be waiting for min (time until next 
> timeout, gui keep alive delta).

Sorry, I've no idea what that means.  Care to explain?

If you want the wait to be for some value other than 10ms,
that's fine with me.  I was trying to make the mininum change
possible while still meeting my goal of not sucking up all of
the CPU time.  How long do you want it? 20ms? 50ms? 100ms?

Much longer than 100ms is probably going to be noticable.

-- 
Grant Edwards
grante@visi.com


  reply	other threads:[~2002-07-15  3:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020711175854.A29971@visi.com>
2002-07-11 16:53 ` Grant Edwards
2002-07-11 17:28   ` Keith Seitz
2002-07-11 17:44     ` Grant Edwards
2002-07-12  8:24   ` Grant Edwards
2002-07-12 11:04     ` Grant Edwards
2002-07-14 10:04       ` Andrew Cagney
2002-07-14 10:10         ` Momchil Velikov
2002-07-14 11:28           ` Andrew Cagney
2002-07-15  0:28             ` Grant Edwards [this message]
2002-07-15  9:42               ` Andrew Cagney
2002-07-15 10:59                 ` Grant Edwards
2002-07-11 19:08 Dan Kegel

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=20020714225500.A1054@grante.dsl.visi.com \
    --to=grante@visi.com \
    --cc=ac131313@ges.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=velco@fadata.bg \
    /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