c
Size: a a a
c
AB
Lumen is not:
A new Elixir-like syntax on top JavaScript.
An Elixir to JavaScript transpiler.
An effort to cross-compile the existing BEAM implementation to Wasm.
An effort to replace the existing BEAM.
AB
AB
ŹR
AB
AB
ML
ДЗ
s
ДЗ
AB
{'EXIT', ..., normal}
, либо пойматься error, noproc
.{'EXIT', ..., noproc}
. $ cat > t.erl
-module(t).
-compile([export_all, nowarn_export_all]).
test() ->
ok = test_(0),
io:format("everything is ok~n").
%%
test_(1000000) ->
ok;
test_(N) ->
try
{ok, Pid} = gen_server:start(?MODULE, [], []),
link(Pid)
catch error:noproc -> ok %% it's ok
end,
test_(N + 1).
%% gen_server
init([]) ->
{ok, undefined, {continue, stop}}.
handle_continue(stop, S) ->
erlang:bump_reductions(rand:uniform(5000)),
{stop, normal, S}.
^D
$ erl
Erlang/OTP 21 [erts-10.3.5.9] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.3.5.9 (abort with ^G)
1> c(t).
{ok,t}
2> t:test().
.....
test #81
** exception exit: noproc
3> t:test().
.....
test #3077
** exception exit: noproc
....
SP
AB
{'EXIT', ..., normal}
, либо пойматься error, noproc
.{'EXIT', ..., noproc}
. $ cat > t.erl
-module(t).
-compile([export_all, nowarn_export_all]).
test() ->
ok = test_(0),
io:format("everything is ok~n").
%%
test_(1000000) ->
ok;
test_(N) ->
try
{ok, Pid} = gen_server:start(?MODULE, [], []),
link(Pid)
catch error:noproc -> ok %% it's ok
end,
test_(N + 1).
%% gen_server
init([]) ->
{ok, undefined, {continue, stop}}.
handle_continue(stop, S) ->
erlang:bump_reductions(rand:uniform(5000)),
{stop, normal, S}.
^D
$ erl
Erlang/OTP 21 [erts-10.3.5.9] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.3.5.9 (abort with ^G)
1> c(t).
{ok,t}
2> t:test().
.....
test #81
** exception exit: noproc
3> t:test().
.....
test #3077
** exception exit: noproc
....
A noproc reason in a 'DOWN' message will be produced if the process that you attempt to monitor is already terminated or is in an exiting state when the monitor signal reaches it. That is, in the general case you cannot conclude that the process you are trying to monitor died with reason noproc.
AB
AK
{'EXIT', ..., normal}
, либо пойматься error, noproc
.{'EXIT', ..., noproc}
. $ cat > t.erl
-module(t).
-compile([export_all, nowarn_export_all]).
test() ->
ok = test_(0),
io:format("everything is ok~n").
%%
test_(1000000) ->
ok;
test_(N) ->
try
{ok, Pid} = gen_server:start(?MODULE, [], []),
link(Pid)
catch error:noproc -> ok %% it's ok
end,
test_(N + 1).
%% gen_server
init([]) ->
{ok, undefined, {continue, stop}}.
handle_continue(stop, S) ->
erlang:bump_reductions(rand:uniform(5000)),
{stop, normal, S}.
^D
$ erl
Erlang/OTP 21 [erts-10.3.5.9] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.3.5.9 (abort with ^G)
1> c(t).
{ok,t}
2> t:test().
.....
test #81
** exception exit: noproc
3> t:test().
.....
test #3077
** exception exit: noproc
....
TT