public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Revert "Cygwin: select: Improve select/poll response."
@ 2021-09-14 15:07 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-09-14 15:07 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b07660ac19f2c5be5ad51d21a969d408dfbf5744

commit b07660ac19f2c5be5ad51d21a969d408dfbf5744
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Sep 8 19:22:40 2021 +0900

    Revert "Cygwin: select: Improve select/poll response."
    
    ... because this commit (23bb19ef) causes high CPU load.

Diff:
---
 winsup/cygwin/select.cc | 32 ++++----------------------------
 1 file changed, 4 insertions(+), 28 deletions(-)

diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 5e338e43f..c85ce748c 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -726,7 +726,6 @@ thread_pipe (void *arg)
   select_pipe_info *pi = (select_pipe_info *) arg;
   DWORD sleep_time = 0;
   bool looping = true;
-  DWORD t0 = GetTickCount ();
 
   while (looping)
     {
@@ -746,12 +745,7 @@ thread_pipe (void *arg)
 	break;
       cygwait (pi->bye, sleep_time >> 3);
       if (sleep_time < 80)
-	{
-	  DWORD t1 = GetTickCount ();
-	  if (t0 != t1)
-	    ++sleep_time;
-	  t0 = t1;
-	}
+	++sleep_time;
       if (pi->stop_thread)
 	break;
     }
@@ -927,7 +921,6 @@ thread_fifo (void *arg)
   select_fifo_info *pi = (select_fifo_info *) arg;
   DWORD sleep_time = 0;
   bool looping = true;
-  DWORD t0 = GetTickCount ();
 
   while (looping)
     {
@@ -947,12 +940,7 @@ thread_fifo (void *arg)
 	break;
       cygwait (pi->bye, sleep_time >> 3);
       if (sleep_time < 80)
-	{
-	  DWORD t1 = GetTickCount ();
-	  if (t0 != t1)
-	    ++sleep_time;
-	  t0 = t1;
-	}
+	++sleep_time;
       if (pi->stop_thread)
 	break;
     }
@@ -1128,7 +1116,6 @@ thread_console (void *arg)
   select_console_info *ci = (select_console_info *) arg;
   DWORD sleep_time = 0;
   bool looping = true;
-  DWORD t0 = GetTickCount ();
 
   while (looping)
     {
@@ -1148,12 +1135,7 @@ thread_console (void *arg)
 	break;
       cygwait (ci->bye, sleep_time >> 3);
       if (sleep_time < 80)
-	{
-	  DWORD t1 = GetTickCount ();
-	  if (t0 != t1)
-	    ++sleep_time;
-	  t0 = t1;
-	}
+	++sleep_time;
       if (ci->stop_thread)
 	break;
     }
@@ -1373,7 +1355,6 @@ thread_pty_slave (void *arg)
   select_pipe_info *pi = (select_pipe_info *) arg;
   DWORD sleep_time = 0;
   bool looping = true;
-  DWORD t0 = GetTickCount ();
 
   while (looping)
     {
@@ -1393,12 +1374,7 @@ thread_pty_slave (void *arg)
 	break;
       cygwait (pi->bye, sleep_time >> 3);
       if (sleep_time < 80)
-	{
-	  DWORD t1 = GetTickCount ();
-	  if (t0 != t1)
-	    ++sleep_time;
-	  t0 = t1;
-	}
+	++sleep_time;
       if (pi->stop_thread)
 	break;
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-14 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 15:07 [newlib-cygwin] Revert "Cygwin: select: Improve select/poll response." Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).