[Web-SIG] WSGI multi threading indications?
foobarbazbaz at yahoo.com
Mon Jan 8 21:54:13 CET 2007
--- "Phillip J. Eby" <pje at telecommunity.com> wrote:
> At 08:38 AM 1/8/2007 -0800, Foobar BazBaz wrote:
> >I'm using wsgiref.simple_server running behind
> >(Created using wsgiref.simple_server.make_server)
> >I see:
> > wsgi.multiprocess is False
> > wsgi.multithread is True
> > wsgi.run_once is False
> >I'm surprised by the value of multithread, since it
> >(and looking at the code seems to verify) that
> >threads are never created; i.e. the server
> >handles one request at a time.
> >Am I missing something?
> The simple_server never creates multiple threads,
> but it's potentially
> multi-threadable. It probably shouldn't be saying
> multithread unless it
> knows it is. The WSGIRequestHandler.handle() method
> is the culprit; it
> should probably be checking self.server in some way
> and passing an
> appropriate multithread flag to the newly created
Yes... that's it exactly. Looking at the code, it
that subclassing WSGIRequestHandler, overriding the
method to dispatch to one of a pool of handler threads
might be an easy way to get reasonalble performance
from this still-simple approach.
At least it *looks* to me like handle method would be
the place to make the transfermation to
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Web-SIG