Recently I was answering an @async related question, and I remembered a documentation warning against @async usage. After checking that out, it was still there:
It is strongly encouraged to favor
Threads.@spawnover@asyncalways even when no parallelism is required especially in publicly distributed libraries. This is because a use of@asyncdisables the migration of the parent task across worker threads in the current implementation of Julia. Thus, seemingly innocent use of@asyncin a library function can have a large impact on the performance of very different parts of user applications.
However, when looking, for example, at the Channels we see @async is being used when instructing how people should use Channels.
So, either the warning is outdated, or the usage of @async in other places of the documentation is somehow problematic (I don’t think it is fair to have people go and check if using @async is good practice - since it is already used in the documentation as a proper way to do things - in this case Channels).
So, which one should we change?