C++ boost共享锁 unique_lock shared_lock
C++ 自带的临界区、Mutex等只支持唯一锁,这对性能是有很大影响的。Boost提供共享锁功能,能够对读写区分加锁。// 头文件#include <boost/thread/shared_mutex.hpp>#include <boost/thread.hpp>typedef boost::shared_mutex Lock;typedef boost::unique_lock<Lock>...