[erlang-questions] Why we need to use make_ref in pmap ?

lang qiu qiulang@REDACTED
Sun Nov 30 16:50:48 CET 2008


Hi all,

Why we need to use make_ref/0 in pmap ? To be exact, why we need to use
make_ref in the gather/2,

gather([Pid|T], Ref) ->
  receive
  {Pid, Ref, Ret} -> [Ret|gather(T, Ref)]
end;

Can't we just use gather/1,

gather([Pid|T]) ->
  receive
  {Pid, Ret} -> [Ret|gather(T)]
end;

Thanks !

Qiulang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081130/333860a6/attachment.htm>


More information about the erlang-questions mailing list