Skip to content

Instantly share code, notes, and snippets.

@lawrencepit
Created January 29, 2009 01:03
Show Gist options
  • Save lawrencepit/54297 to your computer and use it in GitHub Desktop.
Save lawrencepit/54297 to your computer and use it in GitHub Desktop.
loop1() ->
receive
Other ->
io:format("Received ~p~n", [Other]),
loop1()
end.
loop2() -> receive Other -> io:format("Received ~p~n", [Other]), loop2() end.
test() ->
Pid1 = spawn(fun loop1/0),
Pid2 = spawn(fun loop2/0),
Pid3 = spawn(fun() -> receive Other -> io:format("Received ~p~n", [Other]) end),
ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment