Redis is lined up. Is it a program that is put in and pulled out immediately? Or a program, and another program ???? Redis single thread, can this be done, there are two programs at the same time, and take at the same time, is it a queue for two programs, instantly only one program can get will not operate at the same time... redis is lined up. Is it a program that is put in and pulled out immediately? Or a program, and another program ????
Redis single thread, can this be done, there are two programs at the same time, take at the same time, is it a queue for two programs, instantly only one program can get
Will it automatically queue up multiple programs that operate at the same time?
Reply content:
Redis is lined up. Is it a program that is put in and pulled out immediately? Or a program, and another program ????
Redis single thread, can this be done, there are two programs at the same time, take at the same time, is it a queue for two programs, instantly only one program can get
Will it automatically queue up multiple programs that operate at the same time?
Redis server does not care about the push and pop processes, but only processes queued requests in sequence.
The push and pop operations of a single process use the list as a queue or stack.
When the message queue is used, the producer push and consumer pop are used.
For rpc asynchronous communication, you can open multiple lists and put req in the receiving queue of the corresponding caller.
First of all, in the concept of concurrency, there is no situation where two threads get data at the same time. It has nothing to do with whether redis is a single thread. it has something to do with several CPUs.
If you are using multiple threads to process data, you should not consider the issue of execution. this order must be messy.