Notes on a Quick Performance Evaluation of std::mutex
Evaluation Method
- Mac OSX 10.10.2 (3 GHz Intel Core i7)
- Debian 3.16.7 x86_64 GNU/Linux (Intel(R) Xeon(R) CPU E3-1220 v5 @ 3.00GHz)
Performance Evaluation
| Operation being evaluated | Processing time on Mac | Processing time on Linux |
| lock/unlock using std::atomic<bool> | 14 ns | 14 ns |
| lock/unlock using std::mutex without contention | 55 ns | 29 ns |
| lock/unlock using std::mutex with contention | 6100 ns | 68 ns |