-
- Downloads
[IO] make the lock implementation protecting a IoContext's cq configurable 
This change introduces a new synchronization primitive "PseudoCountingTryLock" which takes an actual lock as template and provides a CountingTryLock interface. By using a PseudoCountingTryLock we don't have to change any synchronization code in IoContext::reapCompletion. Since all PseudoCountingTryLock code is defined in a header the compiler should see our constant return values and hopefully optimize away any check depending on those constant return values. Options: * spin_lock - naive CAS spin lock * mutex - std::mutex * counting_try_lock (default) - our own lightweight special purpose synchronization primitive
parent
f825d238
Branches
No related tags found
Showing
- emper/io/IoContext.hpp 20 additions, 2 deletionsemper/io/IoContext.hpp
- emper/lib/sync/PseudoCountingTryLock.hpp 25 additions, 0 deletionsemper/lib/sync/PseudoCountingTryLock.hpp
- emper/lib/sync/SpinLock.hpp 28 additions, 0 deletionsemper/lib/sync/SpinLock.hpp
- meson.build 3 additions, 0 deletionsmeson.build
- meson_options.txt 7 additions, 0 deletionsmeson_options.txt
emper/lib/sync/PseudoCountingTryLock.hpp
0 → 100644
emper/lib/sync/SpinLock.hpp
0 → 100644
Please register or sign in to comment