why Redis is single threaded(event driven)

后端 未结 2 756
情歌与酒
情歌与酒 2020-12-29 16:55

I am trying to understanding basics of Redis. One that that keep coming everywhere is, Redis is single threaded that makes things atomic.But I am unable to imagine how this

2条回答
  •  遥遥无期
    2020-12-29 17:04

    The correct answer is Carl's, of course. However.

    In Redis v4 we're seeing the beginning of a shift from being mostly single threaded to selectively and carefully multi threaded. Modules and thread-safe contexts are one example of that. Another two are the new UNLINK command and ASYNC mode for FLUSHDB/FLUSHALL. Future plans are to offload more work that's currently being done by the main event loop (e.g. IO-bound tasks) to worker threads.

提交回复
热议问题