Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Path
  • Cache Coherency Glossary
  • The Shared Course Model
  • Cache Coherency Revision Sheet
  • Why Coherence Exists8
  • States and Protocols12
    • Single-Writer, Multiple-Reader Invariant
      • SWMR Precisely
      • The Data-Value Invariant
      • Invalidate Versus Update
      • What a Violation Looks Like
    • Line States and Transitions
    • Directory Versus Snoop Fundamentals
  • Transactions12
  • Races and Controller Design8
  • Progress and the Fabric16
  • Ordering and Synchronization12
  • Performance and Scalability12
  • Real Protocols12
  • SoC Integration12
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Single-Writer, Multiple-Reader Invariant
  1. Topics
  2. Cache Coherency
  3. States and Protocols
  4. Single-Writer, Multiple-Reader Invariant
  5. Invalidate Versus Update

Part 2 · States and Protocols · All levels

Invalidate Versus Update

Explain why invalidation acknowledgements precede writable Data and compare that policy with ordered update schemes.

On this page

    Why discard another cache's copy instead of sending it the new value? Both invalidation and update policies address replicated data, but they make different promises about when a retained copy can serve a read. This course uses invalidation: remove independent readers, grant exclusive permission, then let the writer perform local stores. Simply sending new bits does not revoke old read permission.

    Prerequisites: SWMR and the data-value invariant. Begin at a settled read epoch: both caches are S / 0, H = S{C0,C1}, memory = 0. The earlier reads have completed; this is a snapshot, not an omitted concurrent transaction.

    Invalidate, account for completion, then grant

    C0 already has the correct data but lacks permission to store. It sends GetM and waits in SM^D (was S, wants M, waiting for Data): loads hit, stores stall. H invalidates C1, collects C1's Inv-Ack, and only then sends Data with M permission and no refill (no bytes need to be resent, since C0 already holds 0). The full step-by-step trace with every state and value lives in Epochs and Serialization; this summary keeps only the boundary.

    Step

    What happens

    C0

    C1

    1. GetM(X)

    C0 asks H for M permission

    SM^D / 0, loads hit, stores stall

    S / 0

    2. Inv(X)

    H revokes C1's read permission

    SM^D / 0

    I / -

    3. Inv-Ack(X)

    H observes revocation, acks 1/1

    SM^D / 0

    I / -

    4. Data(M permission, no refill)

    H grants write permission

    M / 0

    I / -

    L. Local store X=1

    Now permitted

    M / 1

    I / -

    The course model collects Inv-Acks at H, so an upgrade with sharers takes four serial legs (GetM, Inv, Inv-Ack, Data). The Primer's design instead sends the acks straight to the requester and puts the ack count in Data, three legs; C0 then waits until it has Data and every ack. Both are legal; what neither may do is let C0 store before C1's revocation is known.

    What an update policy changes

    Question

    Invalidate policy used here

    Update policy, conceptual comparison

    Other cached copies

    Lose usable permission before exclusive writes

    May be retained under explicit update-ordering rules

    Next read at C1

    Needs a new permission and data transaction

    May use a retained copy once the policy makes it current

    Repeated local stores at C0

    Can stay local while exclusive permission lasts

    Propagating new values can add traffic even without remote reads

    Safety obligation

    Exclude other usable copies before a writable grant

    Define ordered writes and when retained copies may satisfy reads

    This is a policy comparison, not an update-protocol trace. We introduce no update opcode or new stable state. A retained reader cannot simply coexist with unrestricted M or E permission; an update design needs its own access and serialization rules. Neither policy wins without a workload: repeated writes with no remote reuse favour suppressing propagation, while prompt remote reuse may make retained copies useful. See the Primer, Chapter 6, invalidate versus update for the design distinction.

    Common pitfall

    Calling an upgrade a data miss can hide the real wait. C0 already holds 0. The missing resource is exclusive permission, which depends on revoking C1's read access. An unchanged value does not eliminate that acknowledgement dependency.

    Interview

    Describe the upgrade in four messages and one local action. Explain that Data can carry permission without a refill, and that the Inv-Ack goes to H in this course model, whereas the Primer routes acks to the requester with an ack count in Data.

    Check yourself At step 2 C1 is already I. May C0 store before H receives step 3?

    No. C0 has not received writable Data, and H still lacks the completion evidence. The controller cannot base a grant on an unobserved remote state. Step 3 clears the dependency, step 4 conveys permission, L performs the store. H must wait here only because the acks go to H; with an ack count in Data and acks to the requester (the Primer's design), H could send Data at once and C0 would wait in SM^AD until all acks arrive.

    Related topics

    • Course Model

    • Full upgrade trace: Epochs and Serialization

    • Next: What a Violation Looks Like

    Previous

    16 / 167

    Next: What a Violation Looks Like

    Up next

    Up nextWhat a Violation Looks Like

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • SWMR Precisely