Created
July 27, 2011 23:03
-
-
Save JakubOboza/1110554 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduceF(ProcCount, Results) -> | |
receive | |
{emit, Ref, Value } -> reduceF(ProcCount, [Value | Results]); | |
{spawn, Ref } -> reduceF(ProcCount + 1, Results); | |
{die, Ref } -> Count = ProcCount - 1, | |
if | |
Count =:= 0 -> Results; | |
true -> reduceF(Count, Results) | |
end | |
after | |
1000 -> ok | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment