--------------------- PatchSet 810 Date: 2000/11/09 20:18:41 Author: hno Branch: hno-2_2-async Tag: (none) Log: More adjustments Members: src/aiops.c:1.1.1.2.2.1.2.4->1.1.1.2.2.1.2.5 src/comm_select.c:1.1.1.2.2.1.2.3->1.1.1.2.2.1.2.4 Index: squid/src/aiops.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/aiops.c,v retrieving revision 1.1.1.2.2.1.2.4 retrieving revision 1.1.1.2.2.1.2.5 diff -u -r1.1.1.2.2.1.2.4 -r1.1.1.2.2.1.2.5 --- squid/src/aiops.c 9 Nov 2000 20:13:12 -0000 1.1.1.2.2.1.2.4 +++ squid/src/aiops.c 9 Nov 2000 20:18:41 -0000 1.1.1.2.2.1.2.5 @@ -1,5 +1,5 @@ /* - * $Id: aiops.c,v 1.1.1.2.2.1.2.4 2000/11/09 20:13:12 hno Exp $ + * $Id: aiops.c,v 1.1.1.2.2.1.2.5 2000/11/09 20:18:41 hno Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -405,11 +405,6 @@ static int queue_count = 0; debug(41, 9) ("aio_queue_request: %p type=%d result=%p\n", request, request->request_type, request->resultp); - /* Give up the CPU to allow threads to pick up the requests */ - if (++queue_count >= NUMTHREADS) { - queue_count = 0; - sched_yield(); - } /* Mark it as not executed (failing result, no error) */ request->ret = -1; request->err = 0; @@ -773,8 +768,8 @@ } done_requests.tailp = &requests->next; } - /* Give up the CPU to allow the blocking thread to release the lock */ - if (done_queue.head) + /* Give up the CPU to allow the thread to do their work */ + if (done_queue.head || request_queue.head) sched_yield(); } Index: squid/src/comm_select.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_select.c,v retrieving revision 1.1.1.2.2.1.2.3 retrieving revision 1.1.1.2.2.1.2.4 diff -u -r1.1.1.2.2.1.2.3 -r1.1.1.2.2.1.2.4 --- squid/src/comm_select.c 9 Nov 2000 17:50:22 -0000 1.1.1.2.2.1.2.3 +++ squid/src/comm_select.c 9 Nov 2000 20:18:41 -0000 1.1.1.2.2.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: comm_select.c,v 1.1.1.2.2.1.2.3 2000/11/09 17:50:22 hno Exp $ + * $Id: comm_select.c,v 1.1.1.2.2.1.2.4 2000/11/09 20:18:41 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -128,7 +128,7 @@ #define commCheckICPIncoming (++icp_io_events > (incoming_icp_interval>> INCOMING_FACTOR)) #define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR)) static int async_io_events = 0; -#define commCheckAIO ((++async_io_events > MAGIC1/2) ? (async_io_events = 0, 1) : 0) +#define commCheckAIO ((++async_io_events > MAGIC1 - 2) ? (async_io_events = 0, 1) : 0) static int commDeferRead(int fd)