We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dad258 commit 65dea23Copy full SHA for 65dea23
1 file changed
include/sqlite-vec-cpp/index/hnsw_threading.hpp
@@ -26,7 +26,7 @@ class SpinLock {
26
/// Thread-local random number generator for parallel operations
27
/// Avoids contention on shared RNG during parallel layer assignment
28
class ThreadLocalRNG {
29
- static thread_local std::mt19937 rng_;
+ static inline thread_local std::mt19937 rng_{std::random_device{}()};
30
std::uniform_real_distribution<float> dist_{0.0f, 1.0f};
31
32
public:
@@ -49,8 +49,6 @@ class ThreadLocalRNG {
49
}
50
};
51
52
-inline thread_local std::mt19937 ThreadLocalRNG::rng_{std::random_device{}()};
53
-
54
/// Per-node lock array using pointer-based storage to avoid move issues
55
class NodeLocks {
56
std::vector<std::unique_ptr<SpinLock>> locks_;
0 commit comments