aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_utils.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-03-20 12:07:42 +0100
committerHenrik Nord <[email protected]>2012-05-21 15:31:22 +0200
commit720b65deff021ddb17aaa125046f97ff13ade883 (patch)
tree612318f9445bcbdf997de037b4c2d85553ff77e0 /lib/dialyzer/src/dialyzer_utils.erl
parent4e1ed3a5666c13d442759e710d9d08280362c0bb (diff)
downloadotp-720b65deff021ddb17aaa125046f97ff13ade883.tar.gz
otp-720b65deff021ddb17aaa125046f97ff13ade883.tar.bz2
otp-720b65deff021ddb17aaa125046f97ff13ade883.zip
Regulate all kinds of running workers up to the number of schedulers
Diffstat (limited to 'lib/dialyzer/src/dialyzer_utils.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_utils.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl
index 2a248fb028..149e777e1f 100644
--- a/lib/dialyzer/src/dialyzer_utils.erl
+++ b/lib/dialyzer/src/dialyzer_utils.erl
@@ -43,7 +43,8 @@
pp_hook/0,
process_record_remote_types/1,
sets_filter/2,
- src_compiler_opts/0
+ src_compiler_opts/0,
+ parallelism/0
]).
-include("dialyzer.hrl").
@@ -536,3 +537,12 @@ pp_unit(Unit, Ctxt, Cont) ->
pp_atom(Atom) ->
String = atom_to_list(cerl:atom_val(Atom)),
prettypr:text(String).
+
+%%------------------------------------------------------------------------------
+
+-spec parallelism() -> integer().
+
+parallelism() ->
+ CPUs = erlang:system_info(logical_processors_available),
+ Schedulers = erlang:system_info(schedulers),
+ min(CPUs, Schedulers).