While Listing 6 shows push_back using the read-write lock.
清单 6 给出使用读写锁的 push_back 方法。
Locking occurs on two levels (see Listing 7) : The list has a read-write lock, while individual nodes contain a mutex.
在两个级别上执行锁定(见清单7):链表有一个读写锁,各个节点包含一个互斥锁。
The reason this technique is called the "cheap read-write lock" is that you are using different synchronization mechanisms for reads and writes.
之所以将这种技术称之为 “开销较低的读-写锁” 是因为您使用了不同的同步机制进行读写操作。
应用推荐