[erlang-questions] restarting childs under simple_one_for_onesupervisor

Lennart Öhman <>
Tue Jan 9 11:06:35 CET 2007

I believe the answer to your question is in, as you seem to be
suspecting, (3).
The simple-one-for-one is not meant for what I believe you
want to do. A child of a simple-one-for-one is not expected
to be managed that much in detail on command by its supervisor.
I guess you have been "attracted" to the possibility to start
children (dynamically) after the creation of the supervisor.
And it seems very easy to start alot of the same kind of process
You can do this almost as easy with a regular one-for-one
supervisor. You simply start a one-for-one without any "regular"
children. Then you add what ever children you need as dynamic
children. Then you can manage them (from a process outside the
hierarchy) as necessary. Your only "trouble" would be that
you need to come up with a (within this supervisor) unique
name for each and every one of them.
Hope this puts you on a track to solving your problem.
Best Regards
Lennart Ohman                   phone   : +46-8-587 623 27
Sjöland & Thyselius Telecom AB  cellular: +46-70-552 6735
Sehlstedtsgatan 6               fax     : +46-8-667 8230
SE-115 28 STOCKHOLM, SWEDEN     email   : 


Från:  genom Sanjaya Vitharana
Skickat: ti 2007-01-09 09:26
Ämne: [erlang-questions] restarting childs under simple_one_for_onesupervisor

Hi All,
simple_one_for_one supervisor supervising for bunch of fsms (gen_fsm).
Need to restart all the childs (fsms) under that simple_one_for_one supervisor.
1.) Are there any way to restart the childs (fsms) one by one?
2.) Are their any way to restart the simple_one_for_one  supervisor instead of above 1 ? so the childs will restart automatically.
3.) What is the proper way if above 1 & 2 methods are not suit for the task.
NOTE: Erlang Manual Says ...
The functions terminate_child/2, delete_child/2 and restart_child/2 are invalid for simple_one_for_one supervisors and will return {error,simple_one_for_one} if the specified supervisor uses this restart strategy.
Thanks in Advance
Sanjaya Vitharana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070109/0bd1bee5/attachment.htm>

More information about the erlang-questions mailing list