Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.11k stars 1.88k forks source link

Why readme does not contain ThreadSafe [feature]? #946

Closed SC-One closed 1 year ago

SC-One commented 1 year ago

What's the issue?

I was trying to work with MMKV and started to import on my application , but problem was started when I wanted start multi threading . I have a big question , Why you didn't write that MMKV is thread safe (in read me)?! [1] cause of that I'm not sure using it in which manners. (because race conditions is undefined behavior , So I should be sure to using in specific manners ,In addition I read the code and saw ThreadLock , But I'm not Sure yet.)

after all of these , Thanks for the Nice library , it's really good tools in specific ways (like setting manager , small database and more). and a note is that is not like SQLite , hence compare MMKV vs SQLite in benchmark and performance is mistake.

The language of MMKV

C++ (NDK)

The version of MMKV

v1.2.14

The platform of MMKV

iOS & Android

The installation of MMKV

git clone -> using cmake. (add_library)

lingol commented 1 year ago

It's such a fundamental feature in modern programming that we don't even think it should be mentioned. As for the SQLite comparison, we see it as a storage engine; as a matter of fact, many use it for key-value storage.

SC-One commented 1 year ago

It's such a fundamental feature in modern programming that we don't even think it should be mentioned. As for the SQLite comparison, we see it as a storage engine; as a matter of fact, many use it for key-value storage. @lingol

It's not fundamentals feature ! , if you use it on C/C++ language , it should be explicitly defined what can do with it , Like Waitfree, LockFree and etc.

lingol commented 1 year ago

Sure.

SC-One commented 1 year ago

It's such a fundamental feature in modern programming that we don't even think it should be mentioned. As for the SQLite comparison, we see it as a storage engine; as a matter of fact, many use it for key-value storage.

Just as note , I think compare it to QSettings(it has more features , but it's good idea to compare on fundamental types). Thanks for answer.