7 ms·
I've used counters in Redis for mutex control. If incr returns 1, it means we have succeeded. Otherwise it decrements it and tries again after 1 second until it
by atamyrat 15y ago
I've used counters in Redis for mutex control. If incr returns 1, it means we have succeeded. Otherwise it decrements it and tries again after 1 second until it suceeds.
Here is the code:
https://gist.github.com/1062584 https://gist.github.com/1062584