Closed davidwed closed 5 years ago
Are all classes in json_dto designed to be reentrant ( like RapidJSON )?
So I can call json_dto::from_json()
, json_dto::to_json()
from different threads ?
IIRC, json_dto-related stuff are stateless. It means that during the call of, for example, json_dto::from_json
there is only local state, that doesn't go out of call scope. So it is safe to call json_dto::from_json
or json_to::to_json
from different threads.
But json_dto doesn't protect the object being serialized/deserialized. So if you call json_dto::to_json
on one thread and modify the same object from another thread, then json_dto won't protect your object from data races.
Thx.
What do you mean?