Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
tlaplus
TLC is a model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.
-
multiversion-concurrency-control
Implementation of multiversion concurrency control, Raft, Left Right concurrency Hashmaps and a multi consumer multi producer Ringbuffer, concurrent and parallel load-balanced loops, parallel actors implementation in Main.java, Actor2.java and a parallel interpreter
- A lot of code won't work for types with no default constructors, but that is at least compile error
- Using memcpy[0] for arbitrary types is just wrong, see [1]
[0] https://github.com/DNedic/lockfree/blob/main/lockfree/inc/bi...
[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p11...
Should be benchmarked against ->
https://github.com/Deaod/spsc_queue
If proven faster OK.. If not.. Well.. back to the drawing board.
Checking the invariant with assert is also useful in my limited experience with concurrency.
https://lamport.azurewebsites.net/tla/tla.html
I think I lean towards per-thread sharding instead of mutex based or lock free data structures except for lockfree ringbuffers.
You can get embarassingly parallel performance if you split your data by thread and aggregate periodically.
If you need a consistent view of your entire set of data, that is slow path with sharding.
In my experiments with multithreaded software I simulate a bank where many bankaccounts are randomly withdrawn from and deposited to. https://github.com/samsquire/multiversion-concurrency-contro...
I get 700 million requests per second due to the sharding of money over accounts.
I think I lean towards per-thread sharding instead of mutex based or lock free data structures except for lockfree ringbuffers.
You can get embarassingly parallel performance if you split your data by thread and aggregate periodically.
If you need a consistent view of your entire set of data, that is slow path with sharding.
In my experiments with multithreaded software I simulate a bank where many bankaccounts are randomly withdrawn from and deposited to. https://github.com/samsquire/multiversion-concurrency-contro...
I get 700 million requests per second due to the sharding of money over accounts.
The code isn't the easiest to read but in glibc it seems that the syscall is only performed if waiter are detected in userspace during an unlock operation
https://github.com/lattera/glibc/blob/master/nptl/pthread_mu...
Related posts
- Ask HN: Usefulness of formal verification (Coq) and formal verification (TLA+)?
- Quint: A specification language based on the temporal logic of actions (TLA)
- Ask HN: How you understand TLA+ and how you use TLA+ in your projects?
- What I've Learned About Formal Methods in Half a Year
- How do I get the set of process identifier of PlusCal?