Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-04-23 12:39:07 +0400
committerCorinna Vinschen <corinna@vinschen.de>2006-04-23 12:39:07 +0400
commitcfa882572aa35a223df6a3356120f6e3e104292d (patch)
treed94c7f3ffce594ca2a93ebd80427256b94c32091 /winsup/cygwin/select.cc
parent3153a0ecae6ec8a71e7c0475feaf03c668421784 (diff)
* select.cc (thread_pipe): Raise sleep time dynamically to speed up
select on pipes when copying lots of data. (thread_mailslot): Ditto for mailslots.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 073e8bcad..970e529f6 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -622,6 +622,7 @@ thread_pipe (void *arg)
{
pipeinf *pi = (pipeinf *) arg;
bool gotone = false;
+ DWORD sleep_time = 0;
for (;;)
{
@@ -645,7 +646,9 @@ thread_pipe (void *arg)
}
if (gotone)
break;
- Sleep (10);
+ Sleep (sleep_time >> 1);
+ if (sleep_time < 20)
+ ++sleep_time;
}
out:
return 0;
@@ -1634,6 +1637,7 @@ thread_mailslot (void *arg)
{
mailslotinf *mi = (mailslotinf *) arg;
bool gotone = false;
+ DWORD sleep_time = 0;
for (;;)
{
@@ -1657,7 +1661,9 @@ thread_mailslot (void *arg)
}
if (gotone)
break;
- Sleep (10);
+ Sleep (sleep_time >> 1);
+ if (sleep_time < 20)
+ ++sleep_time;
}
out:
return 0;