1

If two Redis clients issue ZADD or ZSCORE commands concurrently, will it have race condition and mess up the set value? If it is not thread-safe, then I will need to protect the commands with a lock, right?

I read the ZSET API reference. Maybe I missed it, but I saw nowhere it mentions the thread-safety of ZSET commands.

Junji Zhi
  • 1,382
  • 1
  • 14
  • 22

1 Answers1

4

I found an answer here. Basically Redis is single threaded and all commands will be queued and serialized, so there is no parallel command execution to worry about.

Community
  • 1
  • 1
Junji Zhi
  • 1,382
  • 1
  • 14
  • 22