The reason this technique is called the "cheap read-write lock" is that you are using different synchronization mechanisms for reads and writes.
之所以将这种技术称之为 “开销较低的读-写锁” 是因为您使用了不同的同步机制进行读写操作。
However, bear in mind the fragility of this pattern: With two competing synchronization mechanisms, this can get very tricky if you branch out beyond the most basic application of this pattern.
然而,要随时牢记这种模式的弱点:如果超越了该模式的最基本应用,结合这两个竞争的同步机制将变得非常困难。
Message blocks and message-passing functions let you write parallel applications without requiring synchronization mechanisms such as locks.
使用消息块和消息传递函数,无需同步机制(如锁)即可编写并行应用程序。
If you must have multiple threads manipulate the same object, you should implement the appropriate synchronization mechanisms, such as critical sections.
如果必须用多线程处理同一对象,则应该执行适当的同步机制,如临界区。
If you must have multiple threads manipulate the same object, you should implement the appropriate synchronization mechanisms, such as critical sections.
如果必须用多线程处理同一对象,则应该执行适当的同步机制,如临界区。
应用推荐