Configuration Reload
-
1. I am using a std::map to store some values of keys 2. On startup of my function i am loading values to my map 3. I am storing values to my map by a http call which is returning the key and values from a file. 4. Now i have changed my configuration file and i want to reload the config map without restarting my process 5. lots of places i am already accessing this map How safely i can reload my configurations? Please need some idea and help Regards, Samba :confused: :confused:
-
1. I am using a std::map to store some values of keys 2. On startup of my function i am loading values to my map 3. I am storing values to my map by a http call which is returning the key and values from a file. 4. Now i have changed my configuration file and i want to reload the config map without restarting my process 5. lots of places i am already accessing this map How safely i can reload my configurations? Please need some idea and help Regards, Samba :confused: :confused:
Soumyadipta wrote:
4. Now i have changed my configuration file and i want to reload the config map without restarting my process 5. lots of places i am already accessing this map How safely i can reload my configurations?
With the limited information you've given at least I can only give a general answer... You have to trigger the "reloading" procedure in some way. If you by "accessing the map" mean that you're using the map from different threads, you also need to provide thread synchronization using a critical section or mutex.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown