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

Vance Shipley <>
Sun Nov 30 23:24:49 CET 2008


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;



More information about the erlang-questions mailing list