- From: Erik Selberg <selberg@cs.washington.edu>
- Date: 24 Oct 1996 13:30:36 -0700
- To: www-lib@w3.org
- Cc: frystyk@w3.org
I've been looking at some performance drags, and I noticed when HTEvent_Loop finally gets around to dealing with pending sockets (in __ProcessFds or HTEvent_Dispatch, whichever version you prefer to use): [windows stuff omitted for clarity] PRIVATE int __ProcessFds( fd_set * fdsp, SockOps ops, CONST char * str) { SOCKET s ; if (THD_TRACE) TTYPrint(TDEST, "Processing.. %s socket set. max_sock is %d\n", str, max_sock); for (s = 0 ; s <= max_sock; s++) { if (FD_ISSET( s, fdsp)) return __DoCallback( s, ops); } return HT_OK; } basically, even if there are more than 1 set socket, you still quit after having processed one. [note: this does mean that for every EventLoop iteration, you can do one read AND one write (and one exception!)]. I was wondering why this was chosen, vs. something like: PRIVATE int __ProcessFds( fd_set * fdsp, SockOps ops, CONST char * str) { SOCKET s ; int e; if (THD_TRACE) TTYPrint(TDEST, "Processing.. %s socket set. max_sock is %d\n", str, max_sock); for (s = 0 ; s <= max_sock; s++) { if (FD_ISSET( s, fdsp)) e = __DoCallback( s, ops); if (e != HT_OK) return e; /* error condition */ } return HT_OK; } -Erik -- Erik Selberg "I get by with a little help selberg@cs.washington.edu from my friends." http://www.cs.washington.edu/homes/selberg
Received on Thursday, 24 October 1996 16:30:45 UTC