This means that in the absence of synchronization, memory operations can appear to happen in different orders from the perspective of different threads.
这意味着在缺乏同步的情况下,从不同的线程角度来看,内存的操作是以不同的次序发生的。
Otherwise, if two threads tried to execute the increment simultaneously, an unlucky interleaving of operations would result in the counter being incremented only once, instead of twice.
否则,如果两个线程试图同时执行增加,操作的不幸交叉将导致计数器只被实现了一次,而不是被实现两次。
However, relying on an assumption that each operation is short, those operations can be distributed among a bounded number of threads to retain a high request throughput.
然而,根据每个操作都很短暂的设想,这些操作可以分配到一组有限的线程中,从而维持较高的请求吞吐量。
应用推荐