What Is false sharing?
What Is false sharing?
False sharing
In computer science, false sharing is a performance degrading consumption pattern that exists in systems with the smallest resource block handled by the cache process that are distributed, coherent caches.
If a participant tries to access data regularly, but these data share a buffer block of modifications, the caching protocol will cause the first participant to reload the entire unit despite an absence of a logical requirement.
In this block, the caching system does not know the operation and forces the participant to bear the caching system overhead that a true mutual access to a resource is needed.
In today's multiprocessor CPU caches, the most common use is by far a small two-word-sized power cache (e.g., 64 aligned, contiguous bytes). If 2 processors run on the same stored memory address in one line with separate data, the system cache coherence mechanisms will push the whole line in the bus or interconnect to each data entry, and forced memory stalls to waste the bandwidth of the system.
Falsch sharing is intrinsic to automatically synchronized cache protocols, but the present prevalence is limited to RAM caches and can be used in contexts such as distributed file systems or databases.
Step by step
Solved in 2 steps with 1 images