线程模型(Thread Model)

概览

ThreadModel是一组策略(Policy Class),用于让其他类/函数按需选择不同线程模型。目前有以下几种线程模型:

规格

ThreadModel本身只是一个规格要求(或者说概念:Concept)。如下:

class ThreadModel
{
public:
    typedef XXX RefCount;
    typedef XXX CriticalSection, CS;
    typedef AutoLock<CS> CSLock;
}

RefCount

CriticalSection, CS

CSLock

  • 临界区自动锁。该类在构造时进行加锁操作,析构时进行解锁操作。详细参见CSLock

相关参考

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License