The Barrier class is used to create synchronization points for multi-phase operations.
Barrier类的作用是在多个阶段的操作之间创建同步点。
LOCK-Based Critical Sections: Although a LOCK-UNLOCK pair does not act as a full memory barrier, these operations do affect memory ordering. Consider the following code.
锁保护的临界区:经lock -UNLOCK对不能实现完全的内存屏障的功能,但是,它们也的确会影响内存访问顺序,参考下面的示例代码。
LOCK-Based Critical Sections: Although a LOCK-UNLOCK pair does not act as a full memory barrier, these operations do affect memory ordering. Consider the following code.
锁保护的临界区:经lock -UNLOCK对不能实现完全的内存屏障的功能,但是,它们也的确会影响内存访问顺序,参考下面的示例代码。
应用推荐