Go crazy, is Redis single-threaded or multi-threaded?

Gejiufelix
Javarevisited
Published in
5 min readOct 14, 2022

--

Photo by Amanda Kerr on Unsplash

For early programmers, Redis is single-threaded, no doubt about it. So why do many friends have doubts about this now? Has Redis changed? Today we understand it all at once. Let’s take a look at these summaries:

After looking at the picture, let’s take a look at the content of each point in detail:

1. First, let’s take a look at the Reactor pattern

(1) Before explaining the Reactor mode, let’s first understand the traditional blocking IO model
Before explaining the text, we will integrate it with examples in life, so it will be easier to understand. For example, if you go to the store to buy the clothes you want, after reading the price, you find that it is too expensive, and then you leave, then the shopping guide waiting for you to place an order during this time is equivalent to a corresponding thread, and you want to place an order. It can be regarded as a connection request alone.

After you have walked around from the outside, you find that the items in this store are the most cost-effective, and then you re-select the purchased products, then…

--

--