Assume we have only one CPU when an auto-detection fails (EJAB-1516)

This commit is contained in:
Evgeniy Khramtsov 2012-02-29 00:45:45 +10:00
parent deb87f2dfa
commit f7b6446c74
1 changed files with 6 additions and 1 deletions

View File

@ -380,7 +380,12 @@ do_setopts(#state{procs_num = N} = State, Opts) ->
shrink_size = ShrinkSize}.
get_proc_num() ->
erlang:system_info(logical_processors).
case erlang:system_info(logical_processors) of
unknown ->
1;
Num ->
Num
end.
get_proc_by_hash(Tab, Term) ->
N = erlang:phash2(Term, get_proc_num()) + 1,