Skip to content

Commit 0e47d8c

Browse files
author
José Valim
committed
Use at least 2 runners regardless of the number of schedulers
1 parent 0872fdd commit 0e47d8c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/elixir/lib/kernel/parallel_compiler.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule Kernel.ParallelCompiler do
3232

3333
defp spawn_compilers(files, path, callback) do
3434
Code.ensure_loaded(Kernel.ErrorHandler)
35-
schedulers = :erlang.system_info(:schedulers_online)
35+
schedulers = max(:erlang.system_info(:schedulers_online), 2)
3636
spawn_compilers(files, path, callback, [], [], schedulers, [])
3737
end
3838

lib/elixir/lib/kernel/parallel_require.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Kernel.ParallelRequire do
1212
can be optionally given as argument.
1313
"""
1414
def files(files, callback // default_callback) do
15-
schedulers = :erlang.system_info(:schedulers_online)
15+
schedulers = max(:erlang.system_info(:schedulers_online), 2)
1616
spawn_requires(files, [], callback, schedulers, [])
1717
end
1818

0 commit comments

Comments
 (0)