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

  • Home
  • SEARCH
  • 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 5944111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:29:28+00:00 2026-05-22T16:29:28+00:00

I implemented an otp system using gen_server and gen_fsm. There is a configuration file

  • 0

I implemented an otp system using gen_server and gen_fsm. There is a configuration file to be read for some values that the software needs in order to run, an example may be:

{values, [value1, value2, value3]}.

I used a macro to extract one of these values

define(VALUES, my_utility:get_conf_value(values)). 

The question is the following: since ?VALUES may be called very often, and therefore the configuration file is parsed many times, should I embed ?VALUES inside the state of my gen_server of gen_fsm and extract it with a call any time I need it?

In fact I really appreciated the previous implementation because one could change the behaviour of the software just by changing the values inside the configuration file, without any #state{} change or call.

Which solution do you prefer?

  • 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-22T16:29:29+00:00Added an answer on May 22, 2026 at 4:29 pm

    The solution will depend upon your requirements. Performance vs “correctness”.

    A possible solution would be to keep the configuration in a process state and re-read it regularly (checking if the file modification time has changed). This might be a good compromise between the two worlds.

    Summary:

    • Re-read from file everytime: always up to date, but slow with unnecessary IO
    • Re-read on interval, store in process state: fast to read, but lagging behind
    • Manual re-read: fast to read, but lagging behind and needs manual trigger
    • Read once and store in process state: fast to read, needs restart to update

    Requirements not considered: security, stability (corrupt config file?)

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

Sidebar

Related Questions

I implemented a custom list view, but now there's no visual feedback that an
I implemented several activities in a wizard-style, that is, there's a next and a
I implemented the Edmonds–Karp algorithm using the Pseudocode that I found in the Edmonds–Karp
I implemented a multi-file gatherer input stream which is able to read and combine
Implemented some barbuttons by using below code, UISegmentedControl *button = [[[UISegmentedControl alloc] initWithItems: [NSArray
I implemented a feature that lets users set default profile photos and photo-album cover
I implemented a tree with an outputResource as content (see Downloading file from IceFaces
I implemented Admob in my application previously in 3.x versions of SDk there i
I implemented a python com server and generate an executable and dll using py2exe
I implemented a client-server program that allows to transfer files b/w them. The server

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.