Supervisor starts children in parallel

Lennart Öhman lennart.ohman@REDACTED
Mon Dec 1 21:19:21 CET 2003


Hmm,
the next child is not supposed start until the previous ones init-phase
has acknowledged back to the supervisor (i.e my_callback_modle:init(...)
has returned {ok,DataStructure}.

Some people wanting a more concurrent start usually make their init
phases empty and keep a state in the DataStrcture. They then send a
cast to change that state into "operational mode" for the worker process
in some kind of order which is not equavalent to the start-order.

But that was not your problem, rather the opposite!?

/Lennart


Vance Shipley wrote:

> The supervisor behaviour seems to start it's children in parallel.
> I have a supervisor with two children in a one_for_all strategy.
> This causes a chicken and egg problem when these processes act as
> a pair.  If they were started synchronously and in order there 
> wouldn't be a problem.  It would be very handy if there were a
> flag to specify either a synchronous or asynchronous startup.
> 
> How do folks deal with this?
> 
> 	-Vance

-- 
-------------------------------------------------------------
Lennart Ohman                   phone   : +46-8-587 623 27
Sjoland & Thyselius Telecom AB  cellular: +46-70-552 6735
Sehlstedtsgatan 6               fax     : +46-8-667 8230
SE-115 28 STOCKHOLM, SWEDEN     email   : lennart.ohman@REDACTED




More information about the erlang-questions mailing list