-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
mark julia threads as initialized #22987
Conversation
Is it possible to add a test for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed to fix the pyjulia issue. Does need a test. Probably the embedding test is the right place to put this.
3f900cd
to
d8d9135
Compare
d8d9135
to
1538e61
Compare
examples/embedding/embedding.c
Outdated
jl_array_t* x = jl_alloc_array_1d(array_type , 10); | ||
jl_value_t* array_type = jl_apply_array_type((jl_value_t*)jl_float64_type, 1); | ||
jl_array_t* x = jl_alloc_array_1d(array_type, 10); | ||
// JL_GC_PUSH* is required here to ensures that `x` is not deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to ensure that
ensures that cfunction can see that Julia state is initialized on this thread also upgrades the embedding/examples test to handle exceptions better (e.g. to actually detect them) while testing for correctness
1538e61
to
98a2d1d
Compare
This ensures that cfunction can see that Julia state is initialized on this thread, and thus letting it run in the newest world age.
I think this should fix JuliaPy/pyjulia#105, although I don't have pyjulia installed right now to test.