-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
Description
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!
Reactions are currently unavailable