Redis itself guarantees mutual exclusion of queue reading and writing. Redis is single-threaded and works roughly like this. Your multi-process reading can actually send multiple read request packets in parallel. These request packets arrive in the socket buffer of redis. The processing of redis is to respond to your request serially without locks. If redis is changed to multi-threading one day, you can also lock the mutex to ensure that nothing happens when reading the queue.
No conflicts, each element in the queue will only be read once.
No problem just reading. . .
Redis itself guarantees mutual exclusion of queue reading and writing. Redis is single-threaded and works roughly like this. Your multi-process reading can actually send multiple read request packets in parallel. These request packets arrive in the socket buffer of redis. The processing of redis is to respond to your request serially without locks. If redis is changed to multi-threading one day, you can also lock the mutex to ensure that nothing happens when reading the queue.