[erlang-questions] Predefined Registered Processes

Michael Turner <>
Mon Jun 4 08:12:46 CEST 2012


It's hard to predict what *could* get registered after start-up - are
there guarantees anywhere? But I've found a way to get by, for now.

Since I'm using the process registry in a kind of hacky way at the
moment, and need to know what I *haven't* registered myself, I
initially get the list of what's currently registered using a call to
registered/0

   http://www.erlang.org/doc/reference_manual/processes.html#id82208

shortly after starting the Erlang shell. I'm not sure how a standalone
app would figure out when a call to registered/0 would return the
complete list -- whatever "complete" means in this case. Does anyone
know? It seems like you'd have to get complete initialization of
everything you use that might register a process, and maybe the only
way to be sure is to keep checking against a list of names to see if
the process has been registered yet. And if you already have that list
....

I also qualify the process names I use, prefixing each with a period
('.'), to help avoid any future clashes. This means putting single
quotes around each process-name atom, but I can live with that. It's
dangerous in the long run, I hope to move to a more sensible scheme
soon, but it's fine for now.

-michael turner

On Mon, Jun 4, 2012 at 1:58 PM, Maruthavanan Subbarayan
<> wrote:
> Hi,
>
> I was wondering do we have any predefined list of registered processes
> listed down?
>
> Because I did a small mistake by chance.
>
> I registered my database supervisor as odbc_sup, after which erlang did not
> allow application:start(odbc) throwing the below exception
>
> {error,{{already_started,<0.62.0>},
>         {odbc_app,start,[normal,[]]}}}
> =INFO REPORT==== 4-Jun-2012::10:23:24 ===
>     application: odbc
>     exited: {{already_started,<0.62.0>},{odbc_app,start,[normal,[]]}}
>     type: temporary
>
> Later I found that odbc library of erlang tries to register its process but
> failing as my database supervisor has already started with same name. after
> renaming it worked.
>
> So thought if we have such a place where it is listed down, it would be
> helpful to some like me; may be the list is big but still wanted to check it
> up.
>
> Thanks,
> Marutha
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list