- 博客(7)
- 收藏
- 关注
转载 zookeeper分布式锁避免羊群效应(Herd Effect)
zookeeper分布式锁避免羊群效应(Herd Effect) 本文主要讲述在使用ZooKeeper进行分布式锁的实现过程中,如何有效的避免“羊群效应( herd effect)”的出现。 一般的分布式锁实现 这里简单的讲下一般的分布式锁如何实现。具体的代码实现可以在这里看到:https://svn.apache.org/repos/asf/zookee
2014-10-27 14:26:40 622
转载 原子锁
CAS操作 在开始说无锁队列之前,我们需要知道一个很重要的技术就是CAS操作——Compare & Set,或是 Compare & Swap,现在几乎所有的CPU指令都支持CAS的原子操作,X86下对应的是 CMPXCHG 汇编指令。有了这个原子操作,我们就可以用其来实现各种无锁(lock free)的数据结构。 这个操作用C语言来描述就是下面这个样子:(代码来自Wikipedia的
2014-10-24 11:48:25 631
原创 mvcc
我们可以采用基于多版本并发控制(Multiversion concurrency control,MVCC)思想的无锁事务机制。人们一般把基于锁的并发控制机制称成为悲观机制,而把MVCC机制称为乐观机
2014-10-21 15:13:23 359
翻译 gcc Options That Control Optimization
are nowhere used in the source file being compiled. Options That Control Optimization These options control various sorts of optimizations. Without any optimization
2014-10-17 10:24:12 770
翻译 为什么线程不能调用fork
The general problem with making fork() work in a multi-threaded world is what to do with all of the threads. There are two alternatives. One is to copy all of the threads into the new process. This
2014-10-15 15:46:57 338
原创 C++面试题
c++一个进程malloc,没有free,程序退出时会回收吗 每个进程有自己独立的4G内存,一个malloc了4G,另外一个malloc 4G能成功吗 内存不足时,淘汰旧页面,换入新页面,页面交换有paging和swapping之分每个进程都有其地址空间,地址空间在逻辑上是连续的物理上可以被分为多个RAM碎片,也可以有部分暂存在磁盘,使得进程可用的内存比实际内存要多操作系统把虚拟内存分成一个个
2014-10-15 00:16:39 1320
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人