Skip to content

Add PYBIND11_SIMPLE_GIL_MANAGEMENT option (cmake, C++ define) #4216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
75acc11
Add option to force the use of the PYPY GIL scoped acquire/release lo…
SeeChange-CI Oct 5, 2022
1cd4cff
Apply suggestions from code review
henryiii Oct 21, 2022
b855af2
Update CMakeLists.txt
henryiii Oct 21, 2022
fb233f0
docs: update upgrade guide
henryiii Oct 23, 2022
7c4f8fe
Update docs/upgrade.rst
henryiii Oct 23, 2022
6f7317e
All bells & whistles.
rwgk Oct 26, 2022
cf1bb86
Add Reminder to common.h, so that we will not forget to purge `!WITH_…
rwgk Oct 26, 2022
8885e79
New sentence instead of semicolon.
rwgk Oct 26, 2022
f2538ba
Temporarily pull in snapshot of PR #4246
rwgk Oct 26, 2022
52629ac
Add `test_release_acquire`
rwgk Oct 26, 2022
4062387
Add more unit tests for nested gil locking
SeeChange-CI Oct 27, 2022
31b3868
Add test_report_builtins_internals_keys
rwgk Oct 27, 2022
87e50b0
Very minor enhancement: sort list only after filtering.
rwgk Oct 27, 2022
fe7470d
Revert change in docs/upgrade.rst
rwgk Oct 28, 2022
897c9dd
Add test_multi_acquire_release_cross_module, while also forcing uniqu…
rwgk Oct 28, 2022
620cc70
Hopefully fix apparently new ICC error.
rwgk Oct 28, 2022
a8ac941
clang-tidy fixes
rwgk Oct 28, 2022
e25bcd9
Workaround for PYPY WIN exitcode None
rwgk Oct 28, 2022
1e72313
Revert "Temporarily pull in snapshot of PR #4246"
rwgk Oct 28, 2022
af1d9ee
Another workaround for PYPY WIN exitcode None
rwgk Oct 28, 2022
83c099d
Clean up how the tests are run "run in process" Part 1: uniformity
rwgk Oct 28, 2022
ee8353e
Clean up how the tests are run "run in process" Part 2: use `@pytest.…
rwgk Oct 28, 2022
5019457
Skip some tests `#if defined(THREAD_SANITIZER)` (tested with TSAN usi…
rwgk Oct 28, 2022
ab45337
Run all tests again but ignore ThreadSanitizer exitcode 66 (this is l…
rwgk Oct 28, 2022
857ee1a
bug fix: missing common.h include before using `PYBIND11_SIMPLE_GIL_M…
rwgk Oct 28, 2022
10b0334
if process.exitcode is None: assert t_delta > 9.9
rwgk Oct 29, 2022
ea8b132
More sophisiticated `_run_in_process()` implementation, clearly repor…
rwgk Oct 30, 2022
4c19a9a
Wrap m.intentional_deadlock in a Python function, for `ForkingPickler…
rwgk Oct 30, 2022
2c5f864
Add link to potential solution for WOULD-BE-NICE-TO-HAVE feature.
rwgk Oct 30, 2022
19513d4
Add `SKIP_IF_DEADLOCK = True` option, to not pollute the CI results w…
rwgk Oct 30, 2022
5ce396e
Add COPY-PASTE-THIS: gdb ... command (to be used for debugging the de…
rwgk Oct 30, 2022
8c9bce0
style: pre-commit fixes
pre-commit-ci[bot] Oct 30, 2022
065ac50
Do better than automatic pre-commit fixes.
rwgk Oct 30, 2022
6984cab
Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` to `pytest_report_header()` (so …
rwgk Oct 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Temporarily pull in snapshot of PR #4246"
This reverts commit 23ac16e.
  • Loading branch information
rwgk committed Oct 30, 2022
commit 1e72313b2bca252c89234f0a88aeba179f640b6f
9 changes: 0 additions & 9 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,6 @@
# define PYBIND11_HAS_U8STRING
#endif

// See description of PR #4246:
#if !defined(NDEBUG) && !defined(PY_ASSERT_GIL_HELD_INCREF_DECREF) \
&& !(defined(PYPY_VERSION) \
&& defined(_MSC_VER)) /* PyPy Windows: pytest hangs indefinitely at the end of the \
process (see PR #4268) */ \
&& !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
# define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
#endif

// #define PYBIND11_STR_LEGACY_PERMISSIVE
// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject
// (probably surprising and never documented, but this was the
Expand Down
10 changes: 0 additions & 10 deletions include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@ class handle : public detail::object_api<handle> {
const handle &inc_ref() const & {
#ifdef PYBIND11_HANDLE_REF_DEBUG
inc_ref_counter(1);
#endif
#if defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
if (m_ptr != nullptr && !PyGILState_Check()) {
throw std::runtime_error("pybind11::handle::inc_ref() PyGILState_Check() failure.");
}
#endif
Py_XINCREF(m_ptr);
return *this;
Expand All @@ -262,11 +257,6 @@ class handle : public detail::object_api<handle> {
this function automatically. Returns a reference to itself.
\endrst */
const handle &dec_ref() const & {
#if defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
if (m_ptr != nullptr && !PyGILState_Check()) {
throw std::runtime_error("pybind11::handle::dec_ref() PyGILState_Check() failure.");
}
#endif
Py_XDECREF(m_ptr);
return *this;
}
Expand Down