]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugfix: Speed up processing of queued events significantly, to not cause
authorhno <>
Sun, 6 Jul 2003 20:16:56 +0000 (20:16 +0000)
committerhno <>
Sun, 6 Jul 2003 20:16:56 +0000 (20:16 +0000)
large delays when under low load.

src/comm.cc
src/comm_poll.cc
src/comm_select.cc
src/protos.h

index 12d0bfd7412b48581dbde218eeb1bbce6f150838..93c0e08cefbae6c4900e7e2b8a982e0e30458f8b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.379 2003/06/24 12:42:25 robertc Exp $
+ * $Id: comm.cc,v 1.380 2003/07/06 14:16:56 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -580,6 +580,8 @@ comm_calliocallback(void)
      */
     PROF_start(comm_calliocallback);
 
+    debug(5, 7) ("comm_calliocallback: %p\n", CommCallbackList.head);
+
     while (CommCallbackList.head != NULL && oldseqnum != ((CommCallbackData *)CommCallbackList.head->data)->result.seqnum) {
         dlink_node *node = (dlink_node *)CommCallbackList.head;
         cio = (CommCallbackData *)node->data;
@@ -590,6 +592,13 @@ comm_calliocallback(void)
     PROF_stop(comm_calliocallback);
 }
 
+bool
+comm_iocallbackpending(void)
+{
+    debug(5, 7) ("comm_iocallbackpending: %p\n", CommCallbackList.head);
+    return CommCallbackList.head != NULL;
+}
+
 void
 CommRead::queueCallback(size_t retval, comm_err_t errcode, int xerrno)
 {
index 96b97c2565138186ac4fcb6a2af599a7e66d205e..6111a66f3574ad3c814d8c743914926d58a6dfd3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_poll.cc,v 1.12 2003/07/06 12:03:40 hno Exp $
+ * $Id: comm_poll.cc,v 1.13 2003/07/06 14:16:57 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -435,6 +435,9 @@ comm_select(int msec)
             return COMM_SHUTDOWN;
         }
 
+        if (comm_iocallbackpending())
+            npending++;
+
         if (npending)
             msec = 0;
 
index 08824ab66d82a5b45dc8bc686ac09f5f79c78323..e87f7498c78c1a02a739c14f24a928817475fa41 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select.cc,v 1.70 2003/07/06 12:03:40 hno Exp $
+ * $Id: comm_select.cc,v 1.71 2003/07/06 14:16:57 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -467,6 +467,9 @@ comm_select(int msec)
         if (msec > MAX_POLL_TIME)
             msec = MAX_POLL_TIME;
 
+        if (comm_iocallbackpending())
+            pending++;
+
         if (pending)
             msec = 0;
 
index f248f54be944d9f6f8c4d7fb088b2f53985dbeba..895b017e600a610a2517a8477f99b298bceb737a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.479 2003/06/19 13:47:25 hno Exp $
+ * $Id: protos.h,v 1.480 2003/07/06 14:16:56 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -123,6 +123,7 @@ extern void clientAccessCheck(void *);
 
 /* comm.c */
 extern void comm_calliocallback(void);
+extern bool comm_iocallbackpending(void); /* inline candidate */
 
 extern int comm_listen(int fd);
 SQUIDCEXTERN int commSetNonBlocking(int fd);