cliqz-oss / keyvi

Keyvi - a key value index that powers Cliqz search engine. It is an in-memory FST-based data structure highly optimized for size and lookup performance.
https://cliqz.com
Apache License 2.0
179 stars 38 forks source link

Thread-safe dictionary load #241

Closed narekgharibyan closed 6 years ago

narekgharibyan commented 6 years ago

Boost json parser depends on boost::spirit, and spirit is not thread-safe by default. so need to enable thread-safety.

Note: Unfortunately I didn't manage to find an easy way to add unit test using boost::tests, but it was tested manually using 5000 concurrent threads.

hendrikmuhs commented 6 years ago

nice catch, I think it is not the only place where property_tree is used.

Unfortunately there is nothing like a common file for such flags which is guaranteed to be included (yet). Some of the rapidjson defines could be moved there as well.

narekgharibyan commented 6 years ago

Yes, sure. Will open up an issue.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 88.374% when pulling 9dd1e19c4d1ad530fe3e4b81352a642b05ab1ec5 on narekgharibyan:threadsafe_dict_load into 7895e6443209b494ed91e6714163e7802cb4284e on cliqz-oss:master.