* select.cc (thread_pipe): Raise sleep time dynamically to speed up

select on pipes when copying lots of data.
	(thread_mailslot): Ditto for mailslots.
This commit is contained in:
Corinna Vinschen
2006-04-23 08:39:07 +00:00
parent 3153a0ecae
commit cfa882572a
2 changed files with 15 additions and 2 deletions

View File

@@ -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;