Skip to content

Commit

Permalink
Use background = true only if multiple threads are available
Browse files Browse the repository at this point in the history
To get something that runs even on single-threaded Julia setups
  • Loading branch information
lorenzoh committed Apr 28, 2022
1 parent 69a58ed commit 331a807
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ end
# since `ThreadedEx` has shown to be more performant. This may
# change in the future.
# See PR 33 https://github.com/JuliaML/MLUtils.jl/pull/33
_default_executor() = TaskPoolEx(basesize=1, background=true)
_default_executor() = TaskPoolEx(basesize=1, background=Threads.nthreads() > 1)


# ## Internals
Expand Down

0 comments on commit 331a807

Please sign in to comment.