If it provides same consistency, is threading like :
sock_read();
lock(datastructures);
set x=3;
unlock(datastructures);
sock_write();
If it provides same consistency, is threading like :
sock_read();
lock(datastructures);
set x=3;
unlock(datastructures);
sock_write();
In the Enterprise codebase we can take snapshots which lets us do reads without the lock but it’s a bit of work to enable for commands so it only applies to KEYS and SCAN at the moment.
When I first tried making KeyDB I used posix locks. Those were way too slow.
Do you have any recommendations for a reading material to understand the underlying concepts?
Generally speaking you don't want to be dealing with this stuff unless you really have to. For 99.999% of people the locking primitives that come with your programming language are good enough.
> If we spin too long the thread will sleep although we wait much longer than any other lock you’ll find.
Did you do any tweaks to mitigate this?
> Generally speaking you don't want to be dealing with this stuff unless you really have to.
Ofcourse. I am just way too curious and excited to learn about these!
[0] - https://github.com/EQ-Alpha/KeyDB/blob/v6.0.16/src/fastlock....