You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq/index.rst
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1133,6 +1133,24 @@ FAQ
1133
1133
<divclass="tip"><strong>Note:</strong> Threading with GIL release was tested but found to have intolerable overhead. Multiprocessing is the better approach for parallelism.</div>
1134
1134
</div>
1135
1135
</div>
1136
+
1137
+
<divclass="faq">
1138
+
<divclass="faq-q"><spanclass="marker">Q</span><spanclass="question">Can I use multithreading with PyMuPDF, perhaps with <ahref="https://docs.python.org/3/howto/free-threading-python.html">free-threading Python</a>?</span><spanclass="toggle">+</span></div>
1139
+
<divclass="faq-a">
1140
+
<p>No, PyMuPDF does not support multithreaded use,
1141
+
even with newer free-thread Python.
1142
+
1143
+
<p>Making PyMuPDF work with threads is a tricky problem.
1144
+
The underlying MuPDF library only provides partial thread safety so the results would not be as performant as might be naively assumed,
1145
+
and the implementation would inevitably introduce and expose subtle bugs.
1146
+
1147
+
<p>Any thread-safe implementation of PyMuPDF would also necessarily impose a single-threaded overhead.
1148
+
1149
+
<p>The preferred approach is to <ahref="../recipes-multiprocessing.html">use multiple processes instead of multiple threads</a>.
0 commit comments