Redis question?

Source: Internet
Author: User
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?

  1. Redis server does not care about the push and pop processes, but only processes queued requests in sequence.

  2. The push and pop operations of a single process use the list as a queue or stack.

  3. When the message queue is used, the producer push and consumer pop are used.

  4. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.