Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #101880
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: parallel (concurrent) eventlet |
| Date | 2016-01-18 09:47 -0700 |
| Message-ID | <mailman.91.1453135930.15297.python-list@python.org> (permalink) |
| References | <CAMyzk1dBvittg2KiE0iavxmWQ+5Mz9iW9TWt8H3SuC0zGM4H4Q@mail.gmail.com> <CAMyzk1frCsTH_4D+0xOoD6KvVw_cTPW7yCHoKJ8G_9MjYy_DTQ@mail.gmail.com> |
On Mon, Jan 18, 2016 at 8:03 AM, David Gabriel <davidgab283@gmail.com> wrote:
> Dears,
>
> Let me add one more detail: When I add these two lines to check whether my
> modules are monkey_patched or not I get *False* as a result.
> I think it is strange to get this result since I patched my modules at the
> beginning using: eventlet.monkey_patch() as detailed here
> <http://eventlet.net/doc/patching.html#import-green>.
>
> print "*****is_monkey_patched(ldap.syncrepl) : %s*****" %
> eventlet.patcher.is_monkey_patched('ldap.syncrepl')
> print "*****is_monkey_patched(ldap.ldapobject) : %s*****" %
> eventlet.patcher.is_monkey_patched('ldap.ldapobject')
In your code you monkey patched the standard library modules, not the
ldap modules, so I think it's unsurprising that these return False.
As to why the ldap modules are blocking, python-ldap uses the OpenLDAP
client which is written in C and thus using its own blocking socket
code rather than the Python socket module. I don't believe it is
possible to "green" that. Therefore I think your only option for
concurrency with python-ldap is threading. It is possible to use
threads in conjunction with eventlet; see
http://eventlet.net/doc/threading.html
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: parallel (concurrent) eventlet Ian Kelly <ian.g.kelly@gmail.com> - 2016-01-18 09:47 -0700
csiph-web