report browser and error_logger

Ulf Wiger etxuwig@REDACTED
Thu Jan 10 10:47:06 CET 2002


I agree with Francesco. Another thought is to use global. While
it may not seem like an obvious choice, global does support
process registration using any Erlang term (instead of just
atoms), and the semantics of global:register_name() and
global:send() are basically the same as for your preferred
approach.

I've used this on occasion in order to globally register process
instances, using {ProcName, Node}. The feature I was after at the
time was a global registry where I could easily find all
instances of ProcName (via global:registered_names()).

This saves you the trouble of implementing your own name server,
and then monitoring processes to make sure that _your_ registry
is properly "garbage collected".

/Uffe


On Wed, 9 Jan 2002, Francesco Cesarini wrote:

>Atoms are not garbage collected in the system, so for every atom you
>create, you will be allocating a few bytes that are never released.
>
>To solve your problem, the first solution that comes to my mind is an
>ets table where you you retrieve and store the pids of the dynamic
>processes, and if the traffic is not too intensive, a name server on
>every node.
>
>The only processes you should register are unique ones which handle a
>single task in the system. The rule of thumb is that if several
>processes run the same code, then they should not be registered.
>
>Regards,
>Francesco
>




More information about the erlang-questions mailing list