This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RDI code busy-waiting on running target?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]