Does all the Redis operations are atomic? if one of the method is performing just simple Redis increment operation do I need to synchronize it to make it thread-safe or Redis will do it for us(if operations are atomic in nature)?
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/3a826dfe-b050-41c2-8002-c2f034d0244d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/CAGadP%3DVPaLasSsTmv8XdO3AnH7n%3Dv1vMdueUk1m43cOMfzeXag%40mail.gmail.com.
if you read the Little redis book at some point this sentence comes.
"You might not know it, but Redis is actually single-threaded, which is how every command is guaranteed to be atomic. While one command is executing, no other command will run."
INCR command won't need any additional actions to make it thread safe(single cluster), but if you do it manually, like:
get value;
value ++;
set value;
you will need to make it thread safe manually;
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/CANr6u%3DGo5m90hpCteoij1V1U8vNo-4JZgo7uGuYHeSoiF7KDwQ%40mail.gmail.com.