Description
This package is a POC implementation of a package that could support a part of usages like JuliaData/DataFrames.jl#3030. APIs can be found here:
ParallelismHints.is_parallelized() -> ans::Bool
: https://github.com/tkf/ParallelismHints.jl/blob/main/src/docs/is_parallelized.mdParallelismHints.within_parallel(f) -> y
: https://github.com/tkf/ParallelismHints.jl/blob/main/src/docs/within_parallel.md
The rough idea is that libraries that spawn tasks wrap the "fork-join region" in within_parallel
and libraries that provide parallelizable algorithms check if they should fallback to serial (or less parallel) algorithm based on what is_parallelized()
returns.
It may be better to integrate this into Julia itself (e.g., when we have JuliaLang/julia#35833) and I also have an idea to use JuliaLang/julia#39773 for providing this information more efficiently. However, until we get there, I think it's a reasonably simple package to have it around and use it right away.
Do people want something like this package? Is the design/direction good (enough)?
Once we decide on the rough design idea, I think it's better to move this package to JuliaParallel organization.