diff options
author | Håvard Pettersen <havardpe@oath.com> | 2020-11-13 09:25:23 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2020-11-13 09:25:23 +0000 |
commit | 7201a4f8b2e54686f6898998fc5b9c9962f3f20e (patch) | |
tree | 9a965ed9d703e9f2881eca7ef194f566e1a7d2f4 /vespalib | |
parent | 5cbb0f6ff268ac75d2d3924e5f29ad8825018a2d (diff) |
add more warnings
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/spin_lock.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/spin_lock.h b/vespalib/src/vespa/vespalib/util/spin_lock.h index 20ab2f16754..9a7d1bb47bd 100644 --- a/vespalib/src/vespa/vespalib/util/spin_lock.h +++ b/vespalib/src/vespa/vespalib/util/spin_lock.h @@ -10,6 +10,15 @@ namespace vespalib { * get the lock since this will not affect the fast-path of obtaining * the lock immediately. * + * Note that multiple threads trying to obtain the lock at the same + * time will reduce performance due to atomic writes against the same + * cache line. + * + * Note that being preempted while holding the lock will reduce + * performance, even more if the thread holding the lock is lower + * priority than the threads trying to obtain the lock. With a + * deterministic scheduler this could even lead to deadlock. + * * This implementation satisfies the BasicLockable requirements, * making it work with things like std::lock_guard. **/ |