June
16th,
2016
##Concurrency
-
start new process,
spawn/1
G = fun(X) -> timer:sleep(X), io:format(“~p~n”, [X]) end. [spawn(fun(X) -> G(X) end) || X <= list:seq(1,10)].
-
send message
self() ! self() ! double
-
receive message
receive Pattern1 when Guard1 -> Expr1; Partern2 when Guard2 -> Expr2; _ -> Expr3 end.