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 7543889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:32:43+00:00 2026-05-30T08:32:43+00:00

In project gproc’s file gen_leader.erl,a customized behavior is created. But In the following statement,

  • 0

In project gproc’s file gen_leader.erl,a customized behavior is created. But In the following statement, what is module “gen”? I can’t find this module in the “erlang document tools http://www.erlang.org/erldoc“? Could you give me some explanation?

behaviour_info(callbacks) ->
    [{init,1},
     {elected,2},
     {surrendered,3},
     {handle_leader_call,4},
     {handle_leader_cast,3},
     {handle_local_only, 4},
     {from_leader,3},
     {handle_call,3},
     {handle_cast,2},
     {handle_DOWN,3},
     {handle_info,2},
     {terminate,2},
     {code_change,4}];
behaviour_info(_Other) ->
    undefined.

start_link(Name, [_|_] = CandidateNodes, Workers, 
       Mod, Arg, Options) when is_atom(Name) ->
    gen:start(?MODULE, link, {local,Name}, Mod, %<<++++++ What's the meaning?
          {CandidateNodes, Workers, Arg}, Options).
  • 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-30T08:32:45+00:00Added an answer on May 30, 2026 at 8:32 am

    It looks like gen:start() is referring to gen.erl. According to the documentation in the file, gen.erl implements the generic parts of gen_server, gen_fsm and other OTP behaviors. In this case, it looks like gen_start handles spawning new processes. It checks to see if a process has already been spawned with the given name. If it has, an error is returned. If it has not, a new process is spawned by calling the module’s start or start_link function.

    In other words, when you call gen_server:start or gen_fsm:start, it calls gen:start (which does basic sanity checking) and gen:start, in turn, calls the module’s start or start_link. When you’re creating custom OTP behaviors, you’ll have to call gen:start directly so that you don’t need to replicate the error checking code in gen.erl.

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

Sidebar

Related Questions

When studying carefully gproc project's gproc_tests.erl file. I have found the following code. The
In emacs, I want to search mnesia key word in project gproc for *.erl
Project explained below is created and built using Eclipse Juno(4.2). We receive the following
My project directory contains a CMakeLists.txt file and src and include directories at its
This project was coped almost exacatly from the example on the admob page but
My project have no visible error but when i try to run it gives
Project file here if you want to download: http://files.me.com/knyck2/918odc So I am working on
When studying the project 'gproc' source code files, I have found several patch files
Our project is using many static libraries to build the application. How can we
I now have a project which I want do profiling on, but it used

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.