5 ms·
I am researching julia's code. https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall.jl https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall....
by guenchi 8y ago
I am researching julia's code.
https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall.jl https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall....
I guess it is like this:
Importing the pycall library is to turn on the python interpreter thread and not interrupt it.
Then you can call any python library you want.
- blattimwind 8y agoThe GIL is mostly managed by CPython and the host application doesn't touch it directly. Host extension modules may use PyEval_SaveThread et al. just like regular extension modules to release the GIL during blocking operations when called by CPython. There is a separate API for fondling the GIL when you're in a host-created thread (not created by CPython) and want to call CPython. Those are orthogonal (called by CPython vs. calling CPython).