Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add vespalib utility functions for atomic memory access | Tor Brede Vekterli | 2022-02-16 | 1 | -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-defined | Tor Brede Vekterli | 2022-02-15 | 1 | -4/+13 |
| | | | | Relaxed loads/stores give the same effect but without the undefined-ness. | ||||
* | Update Verizon Media copyright notices. | gjoranv | 2021-10-07 | 2 | -2/+2 |
| | |||||
* | Include array to get definition of std::array. | Tor Egge | 2020-11-23 | 1 | -0/+1 |
| | |||||
* | fix typo | Håvard Pettersen | 2020-11-13 | 1 | -1/+1 |
| | |||||
* | added spin lock with test | Håvard Pettersen | 2020-11-12 | 2 | -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). |