Hi,
Are nlohmann::json objects thread safe for read only operations? E.g. assuming that the json object is not modified anymore after load_json(), can I safely query the json object from multiple threads as in the example below?
// single threaded
auto json = load_json();
#pragma omp parallel for
for (int i = 0; i < threads; i++)
{
// multi-threaded read only accesses
double seconds = json["S2_easy"]["seconds"];
int count = json["S2_easy"].count("s2_easy");
}
Thanks!
Hi,
Are
nlohmann::jsonobjects thread safe for read only operations? E.g. assuming that thejsonobject is not modified anymore afterload_json(), can I safely query thejsonobject from multiple threads as in the example below?Thanks!