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
I just came across https://clemens-cords.com/jluna/multi_threading.html and I wanted to provide a little bit of context.
Julia uses thread-local-state on it's worker-threads and the GC needs to be able to find that TLS in order to scan the task
stack. This causes your observation:
This is, because the Julia C-API is seemingly hardcoded to prevent any call of C-API functions from anywhere but master scope (the scope of the thread main is executed in).
The first thing many Julia functions do is to look at the TLS and use it to allocate, or interact with the runtime in other ways.
Julia 1.9 finally allows for foreign threads to be added JuliaLang/julia#46609, hopefully this will simplify your work.
The text was updated successfully, but these errors were encountered:
But it is not merged yet so the current docs do not reflect this change.
I also marked the multi-threading docs as experimental and that the interface may be deprecated or removed completely, once 1.9 releases as stable I'll redo them but it will be be some time until then
I may edit the docs with the context about TLS but I don't think any action regarding this issue needs to be taken so I'll close it. I do welcome the update though so thank you for the additional information
I just came across https://clemens-cords.com/jluna/multi_threading.html and I wanted to provide a little bit of context.
Julia uses thread-local-state on it's worker-threads and the GC needs to be able to find that TLS in order to scan the task
stack. This causes your observation:
The first thing many Julia functions do is to look at the TLS and use it to allocate, or interact with the runtime in other ways.
Julia 1.9 finally allows for foreign threads to be added JuliaLang/julia#46609, hopefully this will simplify your work.
The text was updated successfully, but these errors were encountered: