aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/erl_prim_loader.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-10 15:42:33 +0100
committerBjörn Gustavsson <[email protected]>2016-03-17 10:20:00 +0100
commitc54c6243423b55602dd7c204f2351852132d4a98 (patch)
tree5598ed9c50ba19fd330f103826f4524590bda5e9 /erts/preloaded/src/erl_prim_loader.erl
parentc3c61822727939b8cad8f9a132602ac015820b93 (diff)
downloadotp-c54c6243423b55602dd7c204f2351852132d4a98.tar.gz
otp-c54c6243423b55602dd7c204f2351852132d4a98.tar.bz2
otp-c54c6243423b55602dd7c204f2351852132d4a98.zip
init: Load modules in parallel using the new loader BIFs
Use erlang:prepare_loading/1 and erlang:finish_loading/1 to load modules in parallel to potentially decrease start-up times.
Diffstat (limited to 'erts/preloaded/src/erl_prim_loader.erl')
-rw-r--r--erts/preloaded/src/erl_prim_loader.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl
index cbcced5512..641abae7b1 100644
--- a/erts/preloaded/src/erl_prim_loader.erl
+++ b/erts/preloaded/src/erl_prim_loader.erl
@@ -56,7 +56,7 @@
-export([purge_archive_cache/0]).
%% Used by init and the code server.
--export([get_modules/3]).
+-export([get_modules/2,get_modules/3]).
-include_lib("kernel/include/file.hrl").
@@ -239,6 +239,13 @@ set_primary_archive(File, ArchiveBin, FileInfo, ParserFun)
purge_archive_cache() ->
request(purge_archive_cache).
+-spec get_modules([module()],
+ fun((atom(), string(), binary()) ->
+ {'ok',any()} | {'error',any()})) ->
+ {'ok',{[any()],[any()]}}.
+
+get_modules(Modules, Fun) ->
+ request({get_modules,{Modules,Fun}}).
-spec get_modules([module()],
fun((atom(), string(), binary()) ->
@@ -338,6 +345,8 @@ handle_request(Req, Paths, St0) ->
{{ok,Paths},St0};
{get_file,File} ->
handle_get_file(St0, Paths, File);
+ {get_modules,{Modules,Fun}} ->
+ handle_get_modules(St0, Modules, Fun, Paths);
{get_modules,{Modules,Fun,ModPaths}} ->
handle_get_modules(St0, Modules, Fun, ModPaths);
{list_dir,Dir} ->