JuliaLang/julia

[docs] Better describe difference role of @spawn in multithreading

Open

#37,011 opened on Aug 12, 2020

View on GitHub
 (0 comments) (3 reactions) (0 assignees)Julia (5,773 forks)batch import
docshelp wantedmultithreading

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (Avg merge 20d 6h) (157 merged PRs in 30d)

Description

https://docs.julialang.org/en/v1/base/multi-threading/#Base.Threads.@spawn says See the manual chapter on threading for important caveats. but in https://docs.julialang.org/en/v1/manual/multi-threading/ the @spawn macro is not used in any bigger example, not elaborated in more detail. Difference and similarity of @async and @spawn should be elaborated more, ideally with demonstration of both @async and @spawn being used with @sync. In https://docs.julialang.org/en/v1/base/parallel/#Base.@sync I see it can be used for @spawn too, but I think actually having example in manual would help much. Some related discussion here: https://julialang.slack.com/archives/C6SMTHQ3T/p1597182853179500

Contributor guide