Rather than hard code a bunch of data into my module I want to read configuration from a json file at startup. The configuration will be relevant to all instances of the module. That is, I don’t want to read the json file multiple times.
Is module construction thread safe? Or more correctly, can there be multiple modules simultaneously constructed? That is, can I solve this with a simple boolean conditional? Would it be better to have a static class for the configuration and let C++ take care of that safety? Is there some other mutex/semaphore/lock mechanism I need to use for stuff like this?
Any help is appreciated. Thanks in advance.