helper: improve windows gdb pipe performance

Reducing the select and MsgWaitForMultipleObjects timeouts to 1ms makes
a 2-300+% increase in the step time of gdb when using pipes under windows OS.

Change-Id: Id7e52cfb2b206347a9caea61672885a3e2b186de
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1050
Tested-by: jenkins
This commit is contained in:
Spencer Oliver 2012-12-12 15:42:01 +00:00
parent 0466ee7e4a
commit 95025349fa
1 changed files with 3 additions and 2 deletions

View File

@ -206,10 +206,11 @@ int win_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct time
aexcept = sock_except;
tvslice.tv_sec = 0;
tvslice.tv_usec = 100000;
tvslice.tv_usec = 1000;
retcode = select(sock_max_fd + 1, &aread, &awrite, &aexcept, &tvslice);
}
if (n_handles > 0) {
/* check handles */
DWORD wret;
@ -217,7 +218,7 @@ int win_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct time
wret = MsgWaitForMultipleObjects(n_handles,
handles,
FALSE,
retcode > 0 ? 0 : 100,
retcode > 0 ? 0 : 1,
QS_ALLEVENTS);
if (wret == WAIT_TIMEOUT) {