Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3850544
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:01:33+00:00 2026-05-19T17:01:33+00:00

Let us say I have one supervisor and I need execute some start_child for

  • 0

Let us say I have one supervisor and I need execute some start_child for this supervisor. Must I first start all of start my supervisors? Or can I only supervisor:start_child(my_sup,[]) without my_sup starting?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:01:34+00:00Added an answer on May 19, 2026 at 5:01 pm

    First you create a supervisor process as part of a supervision tree calling supervisor:start_link/2 or supervisor:start_link/3. The created supervisor process calls Module:init/1 to find out about restart strategy, maximum restart frequency and child specifications.

    This is the example code for a supervisor starting gen_server (though, you may start other gen_* modules):

    -module(ch_sup).
    -behaviour(supervisor).
    -export([start_link/0]).
    -export([init/1]).
    start_link() ->
        supervisor:start_link(ch_sup, []).
    init(_Args) ->
        {ok, {{one_for_one, 1, 60},
              [{ch3, {ch3, start_link, []},
                permanent, brutal_kill, worker, [ch3]}]}}.
    

    The tuple {ch3, ...} is a child specification, which is defined this way:

    {Id, StartFunc, Restart, Shutdown, Type, Modules}
    

    The child specification to start the server ch3 in the example above looks like:

    {ch3, {ch3, start_link, []}, permanent, brutal_kill, worker, [ch3]}
    

    From the example you see that module ch3 will be started, monitored and stopped by supervisor, you also see one_for_one restart strategy specified which is generally used. one_for_one in the child specification means that if one child process terminates and should be restarted, only that child process is affected, and this is probably your case. Your child processes are started, monitored, restarted and stopped automatically by supervisor.

    start_child/2 is used to dynamically add a child specification to the supervisor SupRef which starts the corresponding child process.

    Thus supervisour is always started first, then its child processes are started automatically or manually based on the restart strategies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Google is failing me on this one. Let's say I have some ECMA script
Let's say you have a text file like this one: http://www.gutenberg.org/files/17921/17921-8.txt Does anyone has
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
Let say i have one asp.net application that is having some page that uses
Let's say I have one class Foo that has a bunch of logic in
Let's say I have two models, Classes and People. A Class might have one
So let's say I have two different functions. One is a part of the
Let say that I have a website with some information that could be access
Let's say I have one class User, and it has a property of type
Let's say I have one project with the following POM: <groupId>com.mine</groupId> <artifactId>coreJar</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.