httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: PR & 1.1b1
Date Tue, 19 Mar 1996 16:04:23 GMT
 2. Singletasking. Using select etc. to do the whole lot in one task (or at
 least, less than one per connection) - the snag with this is that a whole pile
 of stuff would need rewriting. But the efficiency boost would be enormous.

NB the "whole pile of stuff" includes anything that invokes rprintf or
rputc --- the code would have to be turned inside-out around those calls.
I've worked on code which was based on state-machines, in this style, and
IMHO, it leads to intolerable maintenance headaches.

My preference would be for a pool-of-threaded-processes server, with
use of native thread support, or Provenzano's pthreads, on platforms
that support them, and a quickie *non-preemptive* threading package
(which someone would have to write) on platforms that don't --- making
it non-preemptive is critical, to avoid stumbling over unprotected
critical sections in the C library (think Yellow Pages, for instance,
as robm has pointed out to me).

Yes, writing a threading package, even a non-preemptive one which would
only have to deal with context switches on explicit yield() calls (which
would, of course, find their way into rprintf(), rputc(), and send_fd()),
is itself a headache.  But, IMHO, it isn't *nearly* the headache that
state-machine coding is.

rst

Mime
View raw message