4 ms·
But your "write" action is separate from the "X.currlock" operations, right? Doesn't it mean that this can happen? A: X.currlock = Token_ID_A A: resou
by viraptor 11y ago
But your "write" action is separate from the "X.currlock" operations, right?
Doesn't it mean that this can happen?
A: X.currlock = Token_ID_A
A: resource read
A: is X.currlock still Token_ID_A? yes
B: X.currlock = Token_ID_B
B: resource read
B: is X.currlock still Token_ID_B? yes
B: resource write
A: resource write
Is there anything that makes the "write-if-currlock == token" operation atomic?
- tptacek 11y agoYes: it turns out, he's stipulating a single server, in which case this is a trivial feature to build. The problem then is, if you're willing to have that single point of failure, you don't need a lock service at all.