<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Oct 8, 2008 at 6:01 PM, Joel Reymont <span dir="ltr"><<a href="mailto:joelr1@gmail.com">joelr1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a safe and efficient way to convert pid to integer and back?<br>
<br>
I'm assigning each running poker game an integer id. I store this id<br>
into every outgoing packet so there's no database lookup.<br>
<br>
I use the id to lookup the game process for every incoming packet,<br>
though. This is proving to be extremely inefficient, even with dirty<br>
mnesia reads.<br>
<br>
I actually repeat the above for every player, so there's twice the<br>
overhead. Is there a way to avoid it?<br>
<br>
This would only apply to running games and connected players so this<br>
would be a temporary integer, valid while the process is alive.<br>
<br>
        Thanks, Joel<br>
<br>
--<br>
<a href="http://wagerlabs.com" target="_blank">wagerlabs.com</a><br>
<br>
</blockquote><div>Hi Joel.<br><br>I haven't - shame on me - looked at your code for the poker server, so this may be a stupid question...<br><br>Could you try to step one step back and explain a bit about the scenario and the requirements you have for the routing of messages. I presume that you have local clients that all connect to your server and the trick is to pass actions around to all players at a table, but how that matches up with Erlang entities is beyond me at this stage.<br>
<br>Off the top of my head things like AMQP or IP multicast could be a neat way of solving your problem, but it depends on how your architecture is and exactly how your routing requirements are. I have practical experience with IP multicast and I am sure that the RabbitMQ guys could help out with guidance on using AMQP.... if those things match your needs.<br>
<br>It might very well be that the pid conversion is a problem you do not need to solve! <br><br>Cheers,<br>Torben <br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
_____________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>