redis 线程安全

遇到好几次同事和朋友问“redis是线程(进程)安全吗?”

Redis is a single-threaded server. It is not designed to benefit from multiple CPU cores. People are supposed to launch several Redis instances to scale out on several cores if needed. It is not really fair to compare one single Redis instance to a multi-threaded data store.so as every command gets queued in a single thread you should be ok as there will never be two commands executing in parallel
翻译:redis是单线程服务器。它的设计并不能从多核cpu中受益。人们可以安装多个redis实例来提高多核cpu的利用率。拿redis更多线程存储服务器做对比是不公平的。每个请求被缓存在一个线程中,一个时间只能有一个线程在处理请求。
参考文献:http://stackoverflow.com/questions/11658272/is-redis-list-or-set-pop-method-thread-safe

转载于:https://www.cnblogs.com/Zhspra/p/4773515.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值