Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any known threading/GIL issues? #108

Closed
PallHaraldsson opened this issue Feb 11, 2022 · 6 comments
Closed

Any known threading/GIL issues? #108

PallHaraldsson opened this issue Feb 11, 2022 · 6 comments

Comments

@PallHaraldsson
Copy link
Contributor

Compared to e.g. PyCall, FYI: JuliaPy/PyCall.jl#882

@cjdoris
Copy link
Collaborator

cjdoris commented Feb 11, 2022

Not as far as I know. Let me know if you have any specific issues.

@cjdoris cjdoris closed this as completed Feb 11, 2022
@Moelf
Copy link

Moelf commented Jul 25, 2023

so do we drop GIL when using JuliaCall? One limitation from JuliaPy is that it doesn't drop GIL, so it's slow when trying to Julia via it as backend of some Python packge

@cjdoris
Copy link
Collaborator

cjdoris commented Jul 26, 2023

Yeah calling into Julia from Julia doesn't unlock the GIL. This is because the Julia code could well call back into Python, which would require automatically relocking the GIL, which is all quite complicated and probably slow in general. If you can guarantee your Julia code doesn't call back into Python, you can release the GIL yourself. A future version of JuliaCall will allow something like some_julia_function.jl_call_nogil(x, y, z) to make this a bit easier.

@Moelf
Copy link

Moelf commented Jul 26, 2023

you can release the GIL yourself.

I don't think you can drop GIL from within normal Python

@cjdoris
Copy link
Collaborator

cjdoris commented Jul 26, 2023

Sure but you can drop it in the Julia code that you're calling.

@Moelf
Copy link

Moelf commented Jul 26, 2023

how do I do that? "host" is Python, they're using calling Julia function for performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants