Discussion:
[comtypes-users] comtypes and the GIL
Uri Cohen
2013-08-27 19:39:14 UTC
Permalink
I use comtypes.automation to access an IDispatch object in an
out-of-process server and it seems to me as if the GIL is not unlocked
during the call. Thus when trying to invoke multiple calls on IDispatch
objects the calls are synchronized by the GIL and all calls block if one of
the server's methods blocks.

I tried to figure myself how the GIL is handled by comtypes, but this seems
to hidden somewhere down the layers in the ctypes implementation.

Does my problem make sense and it is a known issue with the GIL? Or should
I look harder for some other cause for my calls being synchronized?

Thanks in advance,
Uri
Thomas Heller
2013-08-29 08:58:04 UTC
Permalink
Post by Uri Cohen
I use comtypes.automation to access an IDispatch object in an
out-of-process server and it seems to me as if the GIL is not unlocked
during the call. Thus when trying to invoke multiple calls on IDispatch
objects the calls are synchronized by the GIL and all calls block if one
of the server's methods blocks.
I tried to figure myself how the GIL is handled by comtypes, but this
seems to hidden somewhere down the layers in the ctypes implementation.
Does my problem make sense and it is a known issue with the GIL? Or
should I look harder for some other cause for my calls being synchronized?
I think there should be another source of your problem.
comtypes/ctypes always releases the GIL when calling or executing
C-code.

Thomas

Loading...