summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/spin_lock
Commit message (Collapse)AuthorAgeFilesLines
* Add vespalib utility functions for atomic memory accessTor Brede Vekterli2022-02-161-12/+5
| | | | | | | | | Adds the following utilities: * Atomic reference wrapper functions for accessing single memory locations as if they were `std::atomic` instances. * Wrappers for less verbose `std::atomic` loads/stores that also sanity-check that accesses are always lock-free.
* Use atomic refs to make spin lock race condition testing well-definedTor Brede Vekterli2022-02-151-4/+13
| | | | Relaxed loads/stores give the same effect but without the undefined-ness.
* Update Verizon Media copyright notices.gjoranv2021-10-072-2/+2
|
* Include array to get definition of std::array.Tor Egge2020-11-231-0/+1
|
* fix typoHåvard Pettersen2020-11-131-1/+1
|
* added spin lock with testHåvard Pettersen2020-11-122-0/+182
The micro-benchmark shows promise (run test manually with 'verbose' as parameter). It indicates that taking and releasing the spin lock from a single thread is cheaper than doing the same with a normal mutex (as expected based on previous tests). However, it also indicates that it is competitive with a normal mutex for short critical sections with multiple threads involved. (on my laptop, only the cases using more threads than cores run faster with a normal mutex, which is a better result than expected).