Ulf Wiger (AL/EAB)
Thu Jan 5 14:00:29 CET 2006
erlang:phash2 doesn't give a unique number.
The idea of hash values is to efficiently identify
a "bucket" in which to store the value. It's ok,
for several values to occupy the same bucket, as
long as there aren't too many. If a bucket overflows,
the idea of linear hashing is to double the hash space
and rehash cleverly.
md5 would be more likely to give a unique value,
but then I would much prefer Mats's solution.
> -----Original Message-----
> [mailto:] On Behalf Of Joel Reymont
> Sent: den 5 januari 2006 13:40
> To: Mats Cronqvist (AL/EAB)
> Cc: Erlang Users' List
> Subject: Re: Storing pids
> It's not worthless if I'm just using it for tracking. All I
> want to do in the end is say "give me all the entries from
> this process" and supply the process id.
> If erlang:phash2 gives a unique number for each pid then
> maybe I can use pid hashes to identify processes in the disk
> log instead of the pids themselves.
> What do you think?
> On Jan 5, 2006, at 12:23 PM, Mats Cronqvist wrote:
> > well, the node id number in the pid is worthless for logging
> > (numbering is different on each erlang node).
More information about the erlang-questions