Conversation
|
Hi! Could you instead protect the concurrent calls to The use of So, to clarify, I suggest using a mutex in |
|
I believe both need to be done, atomics to avoid data races, expose them as non atomics values and use them with mutexes when necessary in irmin. |
|
Mutexes are enough to protect from data races and make it easier to avoid race conditions (the same way kcas does). Also, the issue with doing a partial fix here is that it may seem thread-safe, while it is not meant to be used without mutexes. To simplify the change in Irmin, you could have a decorator module |
|
As you prefer, I'll look into that |
Index should not be expected to be thread safe, however it's stats might be acceded from several domains.
This PR simply replaces the global stats with atomics, better than nothing and avoids basic race conditions.