Skip to content

Commit 7c93ef2

Browse files
committed
Add some docs cross references
1 parent b6fcab6 commit 7c93ef2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/advanced/embedding.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ naturally:
216216
:func:`py::mod_gil_not_used()`,
217217
:func:`py::multiple_interpreters::per_interpreter_gil()`, and
218218
:func:`py::multiple_interpreters::shared_gil()` tags just like ``PYBIND11_MODULE``.
219-
See the multiple interpreters and free-threading sections of the pybind11 docs for
220-
more information.
219+
See :ref:`misc_subinterp` and :ref:`misc_free_threading` for more information.
221220

222221

223222
Interpreter lifetime
@@ -249,8 +248,8 @@ global data. All the details can be found in the CPython documentation.
249248

250249
.. _subinterp:
251250

252-
Sub-interpreter support
253-
=======================
251+
Embedding Sub-interpreters
252+
==========================
254253

255254
A sub-interpreter is a separate interpreter instance which provides a
256255
separate, isolated interpreter environment within the same process as the main
@@ -418,3 +417,5 @@ Best Practices for sub-interpreter safety:
418417
- When using multiple threads to run independent sub-interpreters, the independent GILs allow
419418
concurrent calls from different interpreters into the same C++ code from different threads.
420419
So you must still consider the thread safety of your C++ code.
420+
421+
- Familiarize yourself with :ref:`misc_concurrency`.

docs/advanced/misc.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ following checklist.
155155
within pybind11 that will throw exceptions on certain GIL handling errors
156156
(reference counting operations).
157157

158+
.. _misc_free_threading:
159+
158160
Free-threading support
159161
==================================================================
160162

@@ -178,6 +180,8 @@ your code is thread safe. Modules must still be built against the Python free-t
178180
enable free-threading, even if they specify this tag. Adding this tag does not break
179181
compatibility with non-free-threaded Python.
180182

183+
.. _misc_subinterp:
184+
181185
Sub-interpreter support
182186
==================================================================
183187

@@ -224,6 +228,8 @@ You can explicitly disable sub-interpreter support in your module by using the
224228
:func:`multiple_interpreters::not_supported()` tag. This is the default behavior if you do not
225229
specify a multiple_interpreters tag.
226230

231+
.. _misc_concurrency:
232+
227233
Concurrency and Parallelism in Python with pybind11
228234
===================================================
229235

0 commit comments

Comments
 (0)