Skip to content

Commit

Permalink
Explicitly describe about multi-threading
Browse files Browse the repository at this point in the history
We do not want to support multi-threading in PyCall.
  • Loading branch information
mrkn authored Oct 22, 2024
1 parent 1f9e8f0 commit 60c6656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pycall.rb supports Ruby version 2.4 or higher.

pycall.rb supports Python version 3.7 or higher.

## PyCall does not support multi-threaded use officially

CPython's C-API has GIL acquiring/releasing functions such as `PyGILState_Ensure` and `PyGILState_Release`. Programmers can call CPython's C-APIs from outside of Python threads if they manage GIL's state by these functions. However, we do not want to officially support the multi-threaded use of PyCall because creating the feature enabling stable multi-threaded use in any situation is too difficult. We want to avoid incurring the costs to support such use cases.

## Note for pyenv users

pycall.rb requires Python's shared library (e.g. `libpython3.7m.so`).
Expand Down

0 comments on commit 60c6656

Please sign in to comment.