This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/mingw32] Adjust select emulation
- From: Christopher Faylor <me at cgf dot cx>
- To: gdb-patches at sourceware dot org
- Date: Mon, 10 Apr 2006 16:59:16 -0400
- Subject: Re: [RFA/mingw32] Adjust select emulation
- References: <20060410174756.GA28805@nevyn.them.org>
On Mon, Apr 10, 2006 at 01:47:56PM -0400, Daniel Jacobowitz wrote:
>This patch makes a couple of changes to the gdb_select emulation, to make
>it work more reliably:
>
> - Check using ioctlsocket FIONREAD before starting a thread for network
> sockets. I'm not entirely sure that this change is responsible, but
> something in this patch makes MinGW TCP debugging a whole lot faster,
> and I think it's this.
> - Check using _kbhit before starting a thread for consoles. This
> makes select return readable when getch() has returned \xE0 and is
> holding on to the second half of an arrow or function key. With
> readline 5.1, this is necessary for arrow keys to be processed
> in a timely fashion.
> - Use simpler synchronization models for the select threads, by adding
> an explicit "done now, go to sleep" step after gdb_select. This
> prevents race conditions between the network select thread and recv,
> which could cause TCP communication to mysteriously lock up if you
> were unlucky about how long your stub took to send a packet.
>
>I think it's much clearer now. It definitely works better.
>
>Chris, does this look OK?
I just skimmed it but it looks ok.
cgf