You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I plan to use this library to parse JSON files in a multithreaded environment. Specifically I am concerned about thread safety with respect to the behaviour of parse() when called simultaneously from different threads. I would appreciate any help or input on this matter.
Thanks,
Tanay
The text was updated successfully, but these errors were encountered:
Internally, the library uses std::map, std::vector and std::string to store values. parse goes sequentially through the input and creates values on the fly. Calling parse from a different thread on the same json value will most likely be problematic.
Something like:
Thread 1: json j1 = json::parse(...);
Thread 2: json j2 = json::parse(...);
should be safe, because the two values j1 and j2 do not share any state.
Hi,
I plan to use this library to parse JSON files in a multithreaded environment. Specifically I am concerned about thread safety with respect to the behaviour of parse() when called simultaneously from different threads. I would appreciate any help or input on this matter.
Thanks,
Tanay
The text was updated successfully, but these errors were encountered: