[erlang-questions] OTP Supervisor Question
Zoltan Lajos Kis
Mon Jan 4 13:29:27 CET 2010
> El Lunes, 4 de Enero de 2010 04:12:40 Chandru escribiĂł:
>> 2010/1/4 Jayson Vantuyl <kagato@REDACTED>
>> > If I'm an OTP-style process (say, a gen_server), and I want to know
>> who my
>> > parent is (say, a supervisor), is this possible using any API, or do I
>> > to pass in the Parent explicitly? Is using supervisor:get_child a
>> good way
>> > to find a process's sibling? Would it be better to start a single
>> > gen_server and have it use normal, linked processes?
>> I think using supervisor:which_children(Sup_ref) is quite reasonable.
>> for this, you'll have to store the process id of the supervisor in all
>> supervised processes.
>> > I have a certain automaton that is represented as a group of three
>> > processes. These processes coordinate and there may be multiple
>> automata on
>> > a single node. I want to put them under a single supervisor, but I'm
>> > struggling a bit to get them to all know each other's PIds without
>> > code to the supervisor (which is bad, right?) and without having to
>> > register them (which would prevent multiple automata per node).
>> As far as I understand, you'll need a two level supervision tree. One
>> supervisor supervising each set of three processes, and those
>> supervisors in
>> turn under a top level supervisor. That way, when any of a set of three
>> processes invoke supervisor:which_children(Sup_ref) on its supervisor,
>> only see that set and nothing else.
> Try aplication docs, maybe thereis some function to traverse aplication
> Este correo no tiene dibujos. Las formas extraĂąas en la pantalla son
> Clist UAH a.k.a Angel
> El Universo es una de esas cosas que sucede de vez en cuando...
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
Something similar is implemented in process_info:do_get_processes/3 in
More information about the erlang-questions