On 16/12/2012 22:58, Adam Preble wrote:
Is the particular focus of your code on getting the GIL released during
longer method invocations?  I don't have any sway with Boost or
anything, so I'm just asking out of my own personal curiosities.  When I
first saw the message, without seeing the code, I was wondering if you
might have coincidentally created a scope-lock kind of thing for
acquiring the GIL in the first place.

Yes, the main point is to provide a reasonably safe, RAII-style mechanism for releasing the GIL around long-running C++ functions. But in addition to a class for releasing (and later reacquiring, hence RAII), I made a class for acquiring the GIL (if it is not held) and releasing it at the end. This allows nesting: complex C++ computations can be done with the GIL released, yet some bits of C++ can call back into Python by using the second class to acquire the GIL when needed.

You needn't have sway with Boost to help here--simply reviewing the code and letting us know if it would help you would be great.


_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to