Opened 10 years ago
#7836 new Patches
Add GIL RAII module to Boost.Python
Reported by: | Owned by: | Ralf W. Grosse-Kunstleve | |
---|---|---|---|
Milestone: | To Be Determined | Component: | python USE GITHUB |
Version: | Boost Development Trunk | Severity: | Not Applicable |
Keywords: | GIL | Cc: |
Description
This ticket follows a recent discussion I started on the Python C++ SIG mailing list (which in turn followed a brief topic on the Boost developers list).
I would like to submit for inclusion in Boost.Python a pair of classes for releasing and acquiring the Python Global Interpreter Lock (GIL) using RAII semantics.
Please see three files attached to this ticket: gil.hpp, gil.cpp, and gil_test.cpp, which implement and (lightly) test this new feature. They are modified from versions I maintain on GitHub in order to make them more compatible with existing code style in Boost.Python.
This code (with different naming conventions but the same logic) has been used successfully by me "in production" and the releaser class is inspired by several examples online that others have until now copy-pasted when needed.
Header file proposed for <boost/python/gil.hpp>