Atomic integer performance gain lazySet

The article β€œ Atomic * .lazySet is a victory in productivity for single authors ,” talks about how lazySet is a weak volatile record (in the sense that it acts as a store-store, not a storage fence). But I don’t understand how the use of semi-potential recording improves concurrent queue performance. How exactly does it offer an additional low latency as stated in the Menta-queue ?

I already read about this implementation and claims to ask about stack overflow: " How are lazySet classes implemented in Java Atomic * and" Atomic Integer lazySet vs set .

+6
source share
1 answer

The problem with volatile write on x86 is that it gives out a complete memory barrier, which causes it to stop until the storage buffer is exhausted. Meanwhile, lazySet on x86 is a simple store. It does not require that all previous stores waiting in the storage buffer be flushed, which allows recording the stream at full speed.

This is described a bit in an article by Martin Thompson .

+1
source

Source: https://habr.com/ru/post/975269/


All Articles