pmemkv icon indicating copy to clipboard operation
pmemkv copied to clipboard

Conditional thread safety

Open igchor opened this issue 4 years ago • 2 comments

Currently, some of the engines are thread safe for operations like put/get/remove while others are not. We could create a config option to specify whether engines like stree/tree3 should provide thread safe put/get/remove methods (by using locks).

In cases where workload is mostly single threaded using stree/tree3 with locks could make sense.

igchor avatar Aug 07 '19 07:08 igchor

This should be the default.

Can you quantify the overhead of having a mutex in the non-scalable implementations? My guess is that it's marginal, and not worth the hassle...

pbalcer avatar Aug 23 '19 18:08 pbalcer

If you decide to make pmemkv non-threadsafe by default for now, you should at least document that. Especially the interactions of parallel puts with foreach that can happen in concurrent engines (which IMHO are a bug and should be made thread-safe...).

pbalcer avatar Sep 24 '19 08:09 pbalcer