lock锁
          10 Feb 2013
           | 
            
          
           | 
            
          
        
        锁
系统锁 原子操作锁 线程锁 数据库锁 共享锁 排他锁 更新锁
互斥锁 自旋锁 skynet 读写锁 可重入锁 悲观锁 乐观锁
c++并发中常用锁
- std::mutex
 - std::lock_guard
 - std::unique_lock
 
锁和线程安全
数据库锁使用
- select field from table for update;
 
不用锁的设计
- std::automic
 - ringbuffer lmax
 - wait-free的队列 skynet
 
ringbuffer http://blog.codingnow.com/2012/02/ring_buffer.html
wait-free http://spartan1.iteye.com/blog/2059120