This is the mail archive of the
mailing list for the GDB project.
Re: non-blocking reads/writes and event loops
- To: Todd Whitesel <toddpw at windriver dot com>
- Subject: Re: non-blocking reads/writes and event loops
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Tue, 20 Jun 2000 10:35:12 -0400 (EDT)
- Cc: ac131313 at cygnus dot com (Andrew Cagney), jingham at apple dot com (Jim Ingham), gdb at sourceware dot cygnus dot com, insight at sourceware dot cygnus dot com ("Insight (GDB GUI)")
- References: <394DAD8D.C100E36F@cygnus.com><200006201043.DAA22919@alabama.wrs.com>
Todd Whitesel writes:
> > For what its worth, for some reason I have preference for the first
> > option - not sure why, perhaphs it is simply that I'm more familar with
> > targets and back-ends.
> IMHO the simplest way is always to invert from the top down, so things are
> just merged into the main event loop as you go.
> > As I noted above, one of the original design decisions for the event
> > loop that it not be re-entrant. The above questions that decision.
> Well that depends on how much of the event loop machinery is used by the
> low-level inversion. If it calls things that assume a single global event
> loop, then we have a problem.
Yes, that wasn't one of the things I worried about when I wrote the
> If you have to invert a low-level algorithm early on, there are a couple
> ways to do it:
> 1. make the event loop machinery instantiable and use a new instance of it.
> THIS IS ARGUABLY NECESSARY FOR MULTIPLE TARGET CONNECTIONS ANYWAY.
> 2. do not attempt to provide full non-blocking facilities yet, just show
> that the low-level code works correctly in inverted form -- its
> sub-event loop just calls it repeatedly, so it still blocks but at
> least uses the new code structure.
Yes, we must do things in smaller steps. Otherwise the task is so
daunting, it will never get done.
There were actually a few things that we were considering as 'next
steps' in the event-loopization process. One is to hook up the async
version of the remote target to the Insight gui. Another is to make a
native target asynchronous. The choice here would be Linux, I
think. Also there are interface/CLI issues (style decisions) still to
be resolved with the asyncrhonous remote target.
As Andrew pointed out, the remote target is the hairy case. We
encountered several problems when writing the asynchronous version. We
got as far as we could, w/o having to revise major assumptions, and
found that we got maybe 70/80 % of the stuff working fine. The
remaining bits were the hard ones (the ones where GDB gets stuck
and you don't know what happened), for which we really need to do
major surgery to remote.c and the layers below that.
Has anybody tried to use 'target async' and 'target extended-async' in
place of 'target remote' and 'target extended-remote'? I have heard no
feedback on them at all.
> IMHO either is fine; which one you use depends on whether you have gotten
> the instantiable event loop machinery working yet.
> > Another decision was that GDB's core assume no threads. Should that too
> > be questioned?
> I don't mind specific native target support assuming threads.
> However using threads as a general method of avoiding the inversion of
> GDB core code is a COP OUT.
> Todd Whitesel
> toddpw @ windriver.com