[erlang-questions] pid to integer and back

Joel Reymont joelr1@REDACTED
Wed Oct 8 18:01:25 CEST 2008


Is there a safe and efficient way to convert pid to integer and back?

I'm assigning each running poker game an integer id. I store this id  
into every outgoing packet so there's no database lookup.

I use the id to lookup the game process for every incoming packet,  
though. This is proving to be extremely inefficient, even with dirty  
mnesia reads.

I actually repeat the above for every player, so there's twice the  
overhead. Is there a way to avoid it?

This would only apply to running games and connected players so this  
would be a temporary integer, valid while the process is alive.

	Thanks, Joel

--
wagerlabs.com








More information about the erlang-questions mailing list