defect
Michael Ströder
michael at stroeder.com
Thu Jun 27 19:47:17 CEST 2002
Jens Vagelpohl wrote:
>
> On Wednesday, June 26, 2002, at 04:58 , Michael Ströder wrote:
>
>> It's possible to make it somewhat simpler since we have a first
>> result() call before the while loops.
>>
>> while all:
>
> this simplified version seems to slow down my setup.
Yes. I wrote that when posting the code snippet.
> here's a result set with leif's version::
Leif's version sets non-zero timeout. Therefore it's faster since
OpenLDAP's ldap_result() can use select() to determine
just-in-time when data is ready to be read. But it blocks which is
a bad thing because of ldap._ldap_lock serializing *all* calls...
Just adding the time.sleep() hands over the CPU to the OS. Off
course the while-loop is not just-in-time there if received data
is ready.
Again, the problem is that the OpenLDAP libs are not thread-safe...
Ciao, Michael.
More information about the python-ldap
mailing list