Computer ORGANIZATION and ARCHITECTURE designing for performance ninth EDITION
Software cache coherence schemes attempt to avoid the need for additional hard-
Ware circuitry and logic by relying on the compiler and operating system to deal with
The problem. Software approaches is attractive because the overhead of detecting
Potential problems is transferred from run time to compile time, and the design
Complexity is transferred from hardware to software. On the other hand, compile-
Time software approaches generally must make conservative decisions, leading to
Inefficient cache utilization.
compiler-based coherence mechanisms perform an in the code to
Determine which data items may become unsafe for caching, and they mark those
Items accordingly. The operating system or hardware then prevents noncacheable
Items from being cached.
The simplest approach is to prevent any shared data variables from being
Cached. This is too conservative, because a shared data structure could be exclusively
Used during some periods and May is effectively read-only during other periods. It
is only during periods if at least one process could update the variable and at least
One other process, may access the variable, that cache coherence are an issue.
More efficient approaches analyze the code to determine safe periods for
Shared variables. The compiler then inserts instructions into the generated code
To enforce cache coherence during the critical periods. A Number of techniques
The been developed for performing, the analysis, and for enforcing the results; See
[LILJ93] and [STEN90] for surveys.
Software Solutions CACHE COHERENCE and the MESI PROTOCOL