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
* slightly more thread safe gc
* use Channel not Vector and make disable/enable a no-op
* document GCHook
* cannot lock channels on julia 1.6
* revert to using a vector for the queue
* restore test script
* combine queue into a single item
* prefer Fix2 over anonymous function
* update docs
* test multithreaded
* test gc from python
* add gc tests
* fix test
* add deprecation warnings
* safer locking (plus explanatory comments)
* ref of weakref
* SpinLock -> ReentrantLock
* SpinLock -> ReentrantLock
* add PythonCall.GIL
* add tests for PythonCall.GIL
* add GIL to release notes
* add GIL release tests from Python
* typo: testset -> testitem
* delete redundant test
* remove out of date comment
* comment erroneous test
* re-enable commented test
* adds AnyValue._jl_call_nogil
* add RawValue._jl_call_nogil
* add docstrings
* add warnings about the GIL to docstrings
* add reference docstrings
* remove big pycall comparison and move pycall help to faq
* document new threading features
* update release notes
* clarification
* rename GIL.release to GIL.unlock and use lock/unlock terminology consistently
---------
Co-authored-by: Christopher Doris <github.com/cjdoris>
Copy file name to clipboardexpand all lines: README.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,8 @@ In this example we use the Python module JuliaCall from an IPython notebook to t
40
40
41
41
## What about PyCall?
42
42
43
-
The existing package [PyCall](https://github.com/JuliaPy/PyCall.jl) is another similar interface to Python. Here we note some key differences, but a more detailed comparison is in the documentation.
43
+
The existing package [PyCall](https://github.com/JuliaPy/PyCall.jl) is another similar interface to Python. Here we note some key differences:.
44
44
- PythonCall supports a wider range of conversions between Julia and Python, and the conversion mechanism is extensible.
45
45
- PythonCall by default never copies mutable objects when converting, but instead directly wraps the mutable object. This means that modifying the converted object modifies the original, and conversion is faster.
46
46
- PythonCall does not usually automatically convert results to Julia values, but leaves them as Python objects. This makes it easier to do Pythonic things with these objects (e.g. accessing methods) and is type-stable.
47
-
- PythonCall installs dependencies into a separate Conda environment for each Julia project. This means each Julia project can have an isolated set of Python dependencies.
48
-
- PythonCall supports Julia 1.6.1+ and Python 3.8+ whereas PyCall supports Julia 0.7+ and Python 2.7+.
47
+
- PythonCall installs dependencies into a separate Conda environment for each Julia project using [CondaPkg](https://github.com/JuliaPy/CondaPkg.jl). This means each Julia project can have an isolated set of Python dependencies.
Copy file name to clipboardexpand all lines: docs/src/faq.md
+14-13
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,22 @@
1
1
# FAQ & Troubleshooting
2
2
3
-
## Is PythonCall/JuliaCall thread safe?
3
+
## Can I use PythonCall and PyCall together?
4
+
5
+
Yes, you can use both PyCall and PythonCall in the same Julia session. This is platform-dependent:
6
+
- On most systems the Python interpreter used by PythonCall and PyCall must be the same (see below).
7
+
- On Windows it appears to be possible for PythonCall and PyCall to use different interpreters.
8
+
9
+
To force PythonCall to use the same Python interpreter as PyCall, set the environment variable [`JULIA_PYTHONCALL_EXE`](@ref pythoncall-config) to `"@PyCall"`. Note that this will opt out of automatic dependency management using CondaPkg.
4
10
5
-
No.
11
+
Alternatively, to force PyCall to use the same interpreter as PythonCall, set the environment variable `PYTHON` to [`PythonCall.python_executable_path()`](@ref) and then `Pkg.build("PyCall")`. You will need to do this each time you change project, because PythonCall by default uses a different Python for each project.
12
+
13
+
## Is PythonCall/JuliaCall thread safe?
6
14
7
-
However it is safe to use PythonCall with Julia with multiple threads, provided you only
8
-
call Python code from the first thread. (Before v0.9.22, tricks such as disabling the
9
-
garbage collector were required.)
15
+
Yes, as of v0.9.22, provided you handle the GIL correctly. See the guides for
16
+
[PythonCall](@ref jl-multi-threading) and [JuliaCall](@ref py-multi-threading).
10
17
11
-
From Python, to use JuliaCall with multiple threads you probably need to set
12
-
[`PYTHON_JULIACALL_HANDLE_SIGNALS=yes`](@ref julia-config) before importing JuliaCall.
13
-
This is because Julia intentionally causes segmentation faults as part of the GC
14
-
safepoint mechanism. If unhandled, these segfaults will result in termination of the
15
-
process. This is equivalent to starting julia with `julia --handle-signals=yes`, the
0 commit comments