manoj 99/04/16 21:25:57
Modified: pthreads/src/include http_accept.h pthreads/src/main http_accept.c http_main.c Log: An attempt to put SINGLE_LISTEN_UNSERIALIZED_ACCEPT support back in. This also moves the SAFE_ACCEPT definition from http_accept.h to http_accept.c since it isn't (and shouldn't be) used in other files anymore. Revision Changes Path 1.6 +0 -2 apache-apr/pthreads/src/include/http_accept.h Index: http_accept.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/include/http_accept.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- http_accept.h 1999/04/17 03:35:53 1.5 +++ http_accept.h 1999/04/17 04:25:55 1.6 @@ -65,8 +65,6 @@ #include "httpd.h" #include "ap_config.h" -#define SAFE_ACCEPT(stmt) do {stmt;} while(0) - /* The info each server thread needs to start correctly. */ typedef struct { 1.9 +16 -0 apache-apr/pthreads/src/main/http_accept.c Index: http_accept.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/http_accept.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- http_accept.c 1999/04/17 01:58:58 1.8 +++ http_accept.c 1999/04/17 04:25:56 1.9 @@ -72,6 +72,15 @@ static int num_listenfds; #if defined (USE_ACCEPT_QUEUE) + +#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT +/* Each thread only listens to one socket in this model, so the starvation + * problem described in manual/misc/perf-tuning.html can't occur here */ +#define SAFE_ACCEPT(stmt) +#else +#define SAFE_ACCEPT(stmt) do {stmt;} while(0) +#endif + /* The queue of sockets we've accepted */ static FDQueue csd_queue; @@ -311,6 +320,13 @@ } #elif defined(USE_MULTI_ACCEPT) + +#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT +#define SAFE_ACCEPT(stmt) do {if(ap_listeners->next != NULL) {stmt;}} while(0) +#else +#define SAFE_ACCEPT(stmt) do {stmt;} while(0) +#endif + /* * USE_MULTI_ACCEPT * Worker threads do the accept and process the request. 1.73 +0 -7 apache-apr/pthreads/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -u -r1.72 -r1.73 --- http_main.c 1999/04/15 20:01:40 1.72 +++ http_main.c 1999/04/17 04:25:56 1.73 @@ -416,13 +416,6 @@ } } -/* On some architectures it's safe to do unserialized accept()s in the single - * Listen case. But it's never safe to do it in the case where there's - * multiple Listen statements. Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT - * when it's safe in the single Listen case. We haven't defined this yet - * for the hybrid server. ZZZ - */ - static void usage(char *bin) { char pad[MAX_STRING_LEN];