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

lang qiu <>
Mon Dec 1 01:17:27 CET 2008


Thanks!

I understand what you were saying. But can we just use a simple atom for it
instead of make_ref() ?

Qiulang

On Mon, Dec 1, 2008 at 6:24 AM, Vance Shipley <> wrote:

> Qiulang,
>
> The reference() value is passed with the query to be included
> in the response so that you may distinguish the answers from
> each other and from other messages which might have the same
> pattern.
>
>        -Vance
>
> On Sun, Nov 30, 2008 at 11:50:48PM +0800, lang qiu wrote:
> }  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;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081201/b30e363e/attachment.html>


More information about the erlang-questions mailing list