Skip to content

Commit 8d255be

Browse files
author
Christopher Doris
committed
update faq
1 parent c5e10bd commit 8d255be

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

docs/src/faq.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# FAQ & Troubleshooting
22

3-
## Heap corruption when using PyTorch ([issue 215](https://github.com/cjdoris/PythonCall.jl/issues/215))
3+
## Is PythonCall/JuliaCall thread safe?
4+
5+
No.
6+
7+
Some rules if you are writing multithreaded code:
8+
- Only call Python functions from the first thread.
9+
- You probably also need to call `PythonCall.GC.disable()` on the main thread before any
10+
threaded block of code. Remember to call `PythonCall.GC.enable()` again afterwards.
11+
(This is because Julia finalizers can be called from any thread.)
12+
- You may still encounter problems (see [#201](https://github.com/cjdoris/PythonCall.jl/issues/201), [#202](https://github.com/cjdoris/PythonCall.jl/issues/202)).
13+
14+
## Does it work on Apple silicon (ARM, M1, M2, ...)?
15+
16+
Maybe. Your mileage may vary.
17+
18+
In general, PythonCall and JuliaCall are only supported on platforms with
19+
[Tier 1](https://julialang.org/downloads/#supported_platforms) level of support by Julia.
20+
Currently, Apple silicon is Tier 2, so is not supported.
21+
22+
Due to time constraints, issues affecting only unsupported platforms will not be
23+
investigated. It is much more likely to be an issue with Julia itself than PythonCall.
24+
25+
## Heap corruption when using PyTorch ([#215](https://github.com/cjdoris/PythonCall.jl/issues/215))
426

527
On some systems, you may see an error like the following when using `torch` and `juliacall`:
628
```text
@@ -12,7 +34,7 @@ Python(65251,0x104cf8580) malloc: *** set a breakpoint in malloc_error_break to
1234

1335
A solution is to ensure that `juliacall` is imported before `torch`.
1436

15-
## `ccall requries the compiler` error when importing some Python libraries
37+
## `ccall requries the compiler` error when importing some Python libraries ([#255](https://github.com/cjdoris/PythonCall.jl/issues/255))
1638
On some systems, you may see an error like the following when import e.g. `matplotlib` before `juliacall`:
1739

1840
```
@@ -28,7 +50,7 @@ ERROR: `ccall` requires the compilerTraceback (most recent call last):
2850
Exception: PythonCall.jl did not start properly
2951
```
3052

31-
As described in [issue 255](https://github.com/cjdoris/PythonCall.jl/issues/255), the likely problem is that the "other" Python library (`matplotlib`, whatever) is loading the system `libstdc++.so`, which isn't compatible with the `libstdc++.so` that Julia ships with.
53+
The likely problem is that the "other" Python library (`matplotlib`, whatever) is loading the system `libstdc++.so`, which isn't compatible with the `libstdc++.so` that Julia ships with.
3254
Linux distributions with older `libstdc++` versions seem more likely to suffer from this issue.
3355
The solution is to either:
3456

0 commit comments

Comments
 (0)