[Web-SIG] Thread-management middleware components?

Ian Bicking ianb at colorstudy.com
Thu Dec 15 21:22:30 CET 2005


Jim Fulton wrote:
> Has anyone written any thread-management middleware components for WSGI?
> Many web applications need to run application code in separate threads.
> Often, the number of threads needs to be limited, either by throttling
> the rate of thread creation, or by dispatching requests to a thread pool.
> This is a capability that could be provided by a server, however, it seems
> that it might be functionality better provided at an intermediate layer to
> make it more pluggable.

Right now all threading and generally concurrency is handled by the 
server.  Since it *has* to be handled by the server, I'm not sure what 
the advantage would be to duplicating that functionality?  Well, 
strictly speaking you could have a server with wsgi.threaded and 
wsgi.multiprocess both being false, and the server presumably being 
asynchronous, but I think that's challenging to fit into the WSGI spec 
-- there was some discussion some time ago that dwindled off, and I 
don't think there was ever any resolution on handling asynchronous 
servers/apps in WSGI.

I don't see a need for a lot of interchangeable thread pools, a handful 
at most should do.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Web-SIG mailing list