Simple threaded web-server based on BaseHTTPServer?

Aahz aahz at pythoncraft.com
Thu Mar 28 22:28:06 EST 2002


In article <3CA36D8D.1080204 at stroeder.com>,
=?ISO-8859-1?Q?Michael_Str=F6der?=  <michael at stroeder.com> wrote:
>Aahz Maruch wrote:
>> In article <3C5976D0.A3A63A46 at stroeder.com>,
>> Michael =?iso-8859-1?Q?Str=F6der?=  <michael at stroeder.com> wrote:
>>> 
>>>In my case (http://web2ldap.de) I'm using threaded BaseHTTPServer
>>>but I'm not really happy with it. Especially since I have to use a
>>>module-wide lock to serialize calls into python-ldap module because
>>>the underlying OpenLDAP libs are not thread-safe. This can block the
>>>whole thing and killing threads on e.g. Linux is not possible.
>>>Having a single-process asyncore design would probably make things
>>>easier.
>> 
>> Add another thread to serialize things instead of using a module-wide
>> lock.
>
>I really wonder how this helps if the call into the underlying module really 
>blocks. BTW: In opposite to my original statement an asyncore design would 
>also not help since the underlying OpenLDAP lib is not designed that way.

I made my suggestion in the context of assuming that your server threads
can continue to interact with the user while waiting for the LDAP call
to complete.  One possible option would be to have your server's LDAP
thread call out to another LDAP server that you write to fork off
processes (that's assuming the LDAP library is concurrent across multiple
processes, of course).
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?



More information about the Python-list mailing list