From ea711586b15af11748a1cfb8e435960bd7aeaaea Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Mon, 13 Jul 2020 11:47:44 +0200 Subject: [PATCH] thread-safety section in README added. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 6e45fec..519ea03 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,21 @@ a validation error occurs and decide what to do (throwing, counting, collecting) Another goal was to use Niels Lohmann's JSON-library. This is why the validator lives in his namespace. +# Thread-safety + +Instance validation is thread-safe and the same validator-object can be used by +different threads: + +The validate method is `const` which indicated the object is not modified when +being called: + +```C++ + json json_validator::validate(const json &) const; +``` + +Validator-object creation however is not thread-safe. A validator has to be +created in one (main?) thread once. + # Weaknesses Numerical validation uses nlohmann-json's integer, unsigned and floating point