Simple threaded web-server based on BaseHTTPServer?

Paul Rubin phr-n2002a at nightsong.com
Thu Jan 31 19:39:03 EST 2002


Mark Hammond <mhammond at skippinet.com.au> writes:
> > I think the best approach (if feasible) is designing the i/o library
> > to always avoid blocking operations.
> 
> But this is a PITA for casual users.  If, for example, you had an IO
> library where "read()" never blocked, then obviously all the code
> would need to add support for some sort of notification when the read
> actually completed and the data is available.  Even then, you would
> find most programmers then simply issue the non-blocking read call,
> and immediately wait for the completion notification - meaning you are
> in the exact same position.

I mean the library would use nonblocking i/o in its low level
implementation.  The Python interpreter/microthread scheduler would
still simulate blocking behavior, so you could code with threads in
the usual way.  The programmer (writing in Python) wouldn't see or
care that the underlying system call was nonblocking.



More information about the Python-list mailing list