Four nodes, one block: directory walkthroughs and the exam exercise
After this lesson you will take any directory entry and any request, name the home, local and remote nodes, write the message sequence with its senders and receivers, and give the final states, sharer bits and owner — the 5-point directory exercise of the recent papers, solved in full.
The paper of 22 June 2026 gives one line, Directory N0 Block B0 | State: SHARED | Sharer Bits: 1001, one event, a Write Miss on B0 from N2, and eleven boxes to fill. Ten of them ask for a name or a state. The seventh asks for a reason: "Is(are) there any message(s) sent from the remote node(s) to the home node? Why?"
N0 and N3 hold copies of B0, and the home is about to destroy them. Should they send their data back first, as an owner in the same position must? Write down yes or no, and why. The lesson comes back to your answer once every scenario of the protocol has run.
One block, one home, three shapes
Take the machine of the three papers and of the notes (Fig. 42, p. 468): four nodes N0 … N3, each with a processor P, a cache C, a main memory MM and a directory D, on one interconnection network. The physical address space is statically partitioned among the nodes, so every block has exactly one home. The notes follow one block, B0, whose home is N0: B0 lives in MM0, and its directory entry lives in D0.
The papers write the entry on one line, and so does this lesson: Directory N0 Block B0 | State: Shared | Sharer Bits: 1001. The state is Uncached, Shared or Modified. The four sharer bits are read left to right as N0 N1 N2 N3, so 1001 means that C0 and C3 hold copies. In Modified exactly one bit is set, and it names the owner.
| Message | From → to | Sent when | Carries the block? |
|---|---|---|---|
| Read Miss (P, A) | local → home | a read misses in the local cache | no |
| Write Miss (P, A) | local → home | a write misses in the local cache | no |
| Invalidate (A) | local → home | a write hits a block the local cache holds Shared | no |
| Invalidate (A) | home → remote | a sharer must drop its copy | no |
| Fetch (A) | home → remote owner | a Read Miss finds the block Modified | no |
| Fetch/Invalidate (A) | home → remote owner | a Write Miss finds the block Modified | no |
| Data Value Reply (D) | home → local | the answer to a Read Miss or a Write Miss | yes |
| Data Write-Back (A, D) | remote owner → home | the answer to a Fetch or a Fetch/Invalidate, or the owner evicts the block | yes |
The three roles come from the same lesson. The home holds the block in its memory and keeps its entry; the local node issues the request; a remote node is one whose cache holds a copy, Shared or Modified. One node can play two roles: in the June 2026 entry N0 is the home and, because C0 holds a copy, also a remote.
Lesson 37 pictured the home as a librarian with a lending card for every book. Asked for a book, the librarian has only three ways to answer, and every scenario of this lesson is one of them (Fig. 1). If the copy on the shelf is good — nobody has the book, or readers hold only photocopies — the librarian lends from the shelf. If readers hold photocopies and someone wants to edit, the readers are told to shred them, and they bring nothing back: a photocopy holds nothing the shelf lacks. If one reader holds the edited master, the shelf copy is out of date, and the master must come back first.
The home answers from its own memory whenever memory is up to date (Uncached, Shared); only in Modified must it first fetch the block from the owner. A clean copy is told to invalidate and sends nothing back.
Two things in the entry make this possible. The state tells the home whether its memory can be trusted: yes in Uncached and Shared, no in Modified. The sharer bits tell it whom to contact, so nothing is ever broadcast: only the nodes the bits name receive a message.
Uncached and Shared: the memory answers
Run the notes' walkthrough on B0 (pp. 469–471). Start from Directory N0 Block B0 | Uncached | 0000: no cache holds B0, and MM0 has the only copy. N1 reads B0 and misses. N1 sends a Read Miss to N0; N0 answers with a Data Value Reply read from MM0 and sets N1's bit: Shared | 0100. Two messages, and memory is still up to date, because N1 holds a clean photocopy.
From the same Uncached entry, a Write Miss from N2 costs two messages too. There is nobody to invalidate, so the home replies at once and records N2 as the owner: Modified | 0010. N2 writes into its copy, and from that moment MM0 is stale.
The Shared cases are the ones the papers ask. Take Shared | 0100, where only C1 holds B0, and the two requests of the notes. The table uses the columns of the June 2025 paper.
| Entry before | Access | Local node | Remote node(s) | Sequence of messages | Entry after |
|---|---|---|---|---|---|
| Uncached | 0000 | Read Miss from N1 | N1 | none | 1. N1 → N0 Read Miss 2. N0 → N1 Data Value Reply (from MM0) | Shared | 0100 |
| Uncached | 0000 | Write Miss from N2 | N2 | none | 1. N2 → N0 Write Miss 2. N0 → N2 Data Value Reply (from MM0) | Modified | 0010 |
| Shared | 0100 | Read Miss from N2 | N2 | N1 (not contacted) | 1. N2 → N0 Read Miss 2. N0 → N2 Data Value Reply (from MM0) | Shared | 0110 |
| Shared | 0100 | Write Miss from N2 | N2 | N1 | 1. N2 → N0 Write Miss 2. N0 → N1 Invalidate 3. N0 → N2 Data Value Reply (from MM0) | Modified | 0010 |
In the Read Miss from N2, N1 is a remote node — its cache holds a copy — yet it receives nothing. In Shared, memory is up to date, so the home replies from MM0 by itself; asking N1 would only add a message.
In the Write Miss from N2, N1 must lose its copy before N2 may write. The home sends N1 an Invalidate, then the Data Value Reply to N2. N1 invalidates and sends no data back: its copy was clean, identical to MM0, so there is nothing to save.
A write hit on a Shared block
The papers add a scenario the notes never walk: the local node already holds the block Shared and writes it. Take the second access of June 2025, Directory N1 Block B1 | Shared | 0110 and a Write Hit from N2. N2 already has the data, so it needs no block, only permission. It sends an Invalidate to the home N1, which invalidates every other sharer — here the copy in its own cache C1 — and makes N2 the owner: Modified | 0010. That is 1 + k messages for k other sharers, and no Data Value Reply. With k = 0 the request is still sent, because the home must learn that N2 now owns a dirty block.
"A write hit on Shared is just a write, so the local node sends a Write Miss." No: a Write Miss asks for the data and gets a Data Value Reply. A write hit on a Shared block sends an Invalidate request and gets no data. The June 2025 and July 2024 papers both test it.
Two quieter cases
When the local node is the home, only the route changes. In the first access of the July 2024 quiz (question 4), N1 reads B1 and N1 is B1's home: C1 asks D1, MM1 answers, and N1's bit is set. It is the same pair of messages, inside one node, and the entry goes from Shared | 1001 to Shared | 1101.
When a sharer evicts its clean copy, nothing is sent at all. The home is not told, so the bit stays at 1: a stale sharer bit. The next Invalidate to that node finds nothing to invalidate, useless but harmless. Only a Modified copy announces its eviction, with a Data Write-Back.
Modified: the home must ask the owner
Now Directory N0 Block B0 | Modified | 0100: N1 owns a dirty copy, and MM0 is stale. Give the block a value to see what moves: C1 holds x = 7, while MM0 still holds the old x = 3. N2 reads B0 (pp. 472–473).
| Access | Sequence of messages | Owner N1 | Entry after | Memory after |
|---|---|---|---|---|
| Read Miss from N2 | 1. N2 → N0 Read Miss 2. N0 → N1 Fetch 3. N1 → N0 Data Write-Back 4. N0 → N2 Data Value Reply | Modified → Shared | Shared | 0110 | up to date |
| Write Miss from N2 | 1. N2 → N0 Write Miss 2. N0 → N1 Fetch/Invalidate 3. N1 → N0 Data Write-Back 4. N0 → N2 Data Value Reply | Modified → Invalid | Modified | 0010 | stale once N2 writes |
| N1 evicts B0 | 1. N1 → N0 Data Write-Back | Modified → Invalid | Uncached | 0000 | up to date |
The read miss needs four messages because the fresh value is in C1, not in MM0. The home sends a Fetch to the owner. N1 answers with a Data Write-Back and keeps a read-only copy, Modified → Shared. The home writes the block into MM0 and forwards it to N2 with a Data Value Reply. The state does not become Modified, because N2 only reads: Shared | 0110 (Fig. 2).
Before: Modified | 0100 — MM0 is stale
After: Shared | 0110 — MM0 is up to date
The write miss has the same four-message shape with one word changed: Fetch/Invalidate. N1 sends the block back and drops its copy, Modified → Invalid, and N2 becomes the new owner, Modified | 0010. For a moment MM0 is up to date again, refreshed by the Data Write-Back. But N2 asked for the block in order to write it, and once it writes, MM0 is stale once more.
In the last case the owner starts the conversation: N1 evicts B0 to make room for another block. A dirty copy cannot be dropped, so N1 sends a Data Write-Back; the home writes it into MM0 and clears the entry: Uncached | 0000, memory up to date, one message (p. 475). The notes call N1 "Remote, Owner" here, because a Data Write-Back always travels remote → home.
Why does the data travel owner → home → local, and not straight to N2?
Because the home is the only place where the requests for B0 are put in order, and before anybody else sees the block it must update two things: the copy in MM0 and the entry. Going through the home costs a fourth message, but every request then finds a consistent entry. Real machines often let the owner send the block straight to the requester and a copy to the home, which saves a hop: the Stanford DASH machine of the resources did so. The June 2026 paper asks for "the reply message sent from the home node to the local node", and the notes' walkthroughs go through the home: so should your answer.
Every scenario of the protocol is now on the table. At the exam, read it by rows: find the state of the entry, then the request, and copy the shape with the actual node names.
| Entry before | Request | Messages, in order | Other copies | Entry after | Memory after | Count |
|---|---|---|---|---|---|---|
| Uncached | Read Miss from L | L → H Read Miss; H → L Data Value Reply | — | Shared, bits = L | up to date | 2 |
| Uncached | Write Miss from L | L → H Write Miss; H → L Data Value Reply | — | Modified, bits = L | stale | 2 |
| Shared | Read Miss from L | L → H Read Miss; H → L Data Value Reply | stay Shared | Shared, bits + L | up to date | 2 |
| Shared | Write Miss from L | L → H Write Miss; H → each sharer Invalidate; H → L Data Value Reply | Shared → Invalid | Modified, bits = L | stale | 2 + k |
| Shared, L a sharer | Write Hit from L | L → H Invalidate; H → each other sharer Invalidate | Shared → Invalid | Modified, bits = L | stale | 1 + k |
| Modified | Read Miss from L | L → H Read Miss; H → owner Fetch; owner → H Data Write-Back; H → L Data Value Reply | owner Modified → Shared | Shared, bits = owner + L | up to date | 4 |
| Modified | Write Miss from L | L → H Write Miss; H → owner Fetch/Invalidate; owner → H Data Write-Back; H → L Data Value Reply | owner Modified → Invalid | Modified, bits = L | stale | 4 |
| Modified | the owner evicts | owner → H Data Write-Back | owner Modified → Invalid | Uncached, 0000 | up to date | 1 |
| Shared | a sharer evicts | none | that copy → Invalid | unchanged (stale bit) | up to date | 0 |
The home's view: one state machine, six invariants
Follow only the entry through the walkthroughs. It goes Uncached → Shared when N1 reads, Shared → Shared when N2 reads too, Shared → Modified when N2 writes, Modified → Shared when another node reads, Modified → Modified when another node writes, Modified → Uncached when the owner evicts. Those six arcs, plus Uncached → Modified, are the whole directory state machine of p. 476 (the notes' Fig. 43): three states, three events — Read Miss, Write Miss and Data Write-Back — described "from the Home directory's perspective".
| Directory state | The caches (MSI states) | Memory |
|---|---|---|
| Uncached | every cache Invalid | up to date: the only copy |
| Shared | one or more caches Shared, the others Invalid | up to date |
| Modified | exactly one cache Modified (the owner), the others Invalid | stale |
The table is the MSI protocol of lesson 35 seen from the home. With snooping, every cache watched the bus and took its own transition. Here the caches still have their Invalid, Shared and Modified states, but the decisions are taken in one place, and the bus events have become messages: a snooped read miss on a Modified block is now a Fetch, a snooped write miss is now an Invalidate or a Fetch/Invalidate, sent only to the nodes the bits name. One arc is missing on purpose: there is no Shared → Uncached, because a clean eviction is silent and the home never learns that the last sharer has left.
The notes' own summary of the arcs (p. 477) repeats the slip of p. 473 on the Modified → Shared arc:
The notes close the chapter with six invariants, conditions that must hold "regardless of the sequence of operations" (p. 478). Each is kept true by particular messages:
- Single owner: at most one cache holds the block Modified. Kept by the Invalidates and the Fetch/Invalidate that go out before the home grants Modified.
- Memory freshness: Shared or Uncached → memory up to date; Modified → memory stale. Kept by the Data Write-Back that every exit from Modified requires.
- Sharer set: the sharer bits list every node that holds a copy. Kept by every miss, which sets the requester's bit. After silent evictions the list may name too many nodes, never too few.
- Owner membership: in Modified the owner is the one bit set.
- State-transition correctness: states change only through the defined messages. (The notes' list leaves out Write Miss; add it.)
- Atomicity of updates: the directory processes one request at a time for a given block. With no bus to order the requests, this is how write serialization comes back: two Write Misses that arrive together are served one after the other.
The directory state machine is MSI seen from the home: Uncached means no copies, Shared means clean copies and fresh memory, Modified means one dirty owner and stale memory. Every message of the protocol is there to keep one of the six invariants true.
The exam exercise in seven moves
The three papers ask the same exercise in three forms. July 2024 asks for the definitions and the message lists (Question 1) and adds a three-access quiz (quiz question 4); June 2025 asks for three accesses with home, local, remotes, messages and the final entry (Question 1); June 2026 asks for one access in eleven boxes (Exercise 3). The moves below solve any of them. Here they solve the hook.
Home. The node named in the entry: Directory N0 Block B0, so the home is N0. It is fixed by the address and never changes during the exercise.
Read the bits. 1001 is N0 N1 N2 N3, so C0 and C3 hold clean copies; the state Shared says that MM0 is up to date.
Local. The node the request comes from: a Write Miss from N2, so the local node is N2. C2 holds no copy, so it really is a miss.
Remotes. Every other node whose bit is 1, or the owner if the state is Modified: N0 and N3. The home's own cache counts too (unless the home is the requester), so N0 is the home and a remote at once.
Shape. Shared and a Write Miss: the memory answers and the sharers are told to leave, 1 + 2 + 1 messages.
Messages, each with sender and receiver. N2 → N0 Write Miss (N2, B0); N0 → N3 Invalidate (B0) and N0 → C0, inside N0, Invalidate (B0); N0 → N2 Data Value Reply, with the block read from MM0. From the remotes to the home: nothing, because their copies were clean.
Final states. C0 Invalid, C3 Invalid, C2 Modified; Directory N0 Block B0 | Modified | 0010; final owner N2; MM0 stale as soon as N2 writes.
Back to the hook. The answer is no: N0 and N3 send nothing to the home. Their copies are Shared, which means clean, identical to MM0, so there is no newer value to save; they simply invalidate. Only an owner in Modified answers the home, with a Data Write-Back, because only an owner holds a value that memory lacks. If you answered yes, you mixed up the two kinds of remote: a sharer drops its copy, an owner returns it. A real machine would send an invalidation acknowledgement, but the course's seven messages have none.
Five checks before you hand in the exercise. The home's own cache is a remote whenever its bit is 1, unless the home is the requester itself. A write hit sends an Invalidate, not a Write Miss, and receives no data. In Shared no Fetch is ever sent. After a read on a Modified block both copies are Shared and memory is up to date. A cache block is Invalid, never "Uncached".
Exam-style questions
Four of the questions are directory questions of the three official papers, word for word: June 2026 Exercise 3, June 2025 Question 1, July 2024 Question 1 and quiz question 4. The other three follow the same patterns. There are no official solutions: the model answers are written here, and every state in them was recomputed.
(22 June 2026, Exercise 3) Consider a directory-based protocol for a distributed shared memory system with 4 nodes (N0, N1, N2, N3). Let's consider: Directory N0 Block B0 | State: SHARED | Sharer Bits: 1001|. Assuming a Write Miss on B0 from N2, please answer to the following questions:
- What is the home node?
- What is local node?
- What is(are) the remote node(s)?
- What is the initial message sent from the local node to the home node?
- What is the reply message sent from the home node to the local node?
- What is the reply message sent from the home node to the remote node(s)?
- Is(are) there any message(s) sent from the remote node(s) to the home node? Why?
- What is the final coherence state of the block in the home cache?
- What is the final coherence state of the block in the local cache?
- What are the final coherence state and the sharers bits of the block in the home directory?
- Which node is the final owner of the block?
Show model answer
| Question | Answer |
|---|---|
| 1. Home node | N0: B0 is in MM0 and its entry in D0. |
| 2. Local node | N2: the node that issues the Write Miss. |
| 3. Remote node(s) | N0 and N3: the nodes whose sharer bits are 1 (1001). N0 is the home and also a remote, because its cache C0 holds a copy. |
| 4. Initial message, local → home | Write Miss (P = N2, A = B0), from N2 to N0. |
| 5. Reply, home → local | Data Value Reply (B0), from N0 to N2, with the block read from MM0: memory is up to date because the state is Shared. |
| 6. Reply, home → remote(s) | Invalidate (B0) from N0 to N3, and to the home's own cache C0 inside N0. |
| 7. Messages remote → home? Why? | No. C0 and C3 hold the block in Shared state: clean copies, identical to MM0, so there is no data to write back; they only invalidate. A Data Write-Back is sent only by an owner in Modified state. |
| 8. Final state in the home cache | Invalid (C0). |
| 9. Final state in the local cache | Modified (C2). |
| 10. Home directory | Directory N0 Block B0 | State: Modified | Sharer Bits: 0010 |
| 11. Final owner | N2. |
Each box takes one line. The three traps of the form: N0 counted among the remotes, the "no" with its reason (clean copies), and Invalid — not Uncached — for the home cache. You may add that a real machine sends invalidation acknowledgements; the message set of the course has none.
(10 June 2025, Question 1) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where we consider the block B1 in the directory of N1: Directory N1 Block B1 | State: Shared | Sharer Bits: 0 1 0 0 |. Given the following sequence of accesses, please answer to the following questions:
- Read Miss on B1 from node N2
- Write Hit on B1 from node N2
- Write Miss on B1 from node N0
For each access: Home node? Local node? Remote node(s)? What is the sequence of messages sent among the nodes? Which are the final coherence state and sharer bits of the block B1 in the home directory?
Show model answer
1. Read Miss on B1 from node N2
| Home node | N1 |
| Local node | N2 |
| Remote node(s) | N1: its cache C1 holds the only copy (not contacted) |
| Sequence of messages | 1. N2 → N1 Read Miss (N2, B1) 2. N1 → N2 Data Value Reply (B1 from MM1, up to date in Shared) |
| B1 in the home directory | State: Shared | Sharer Bits: 0 1 1 0 |
2. Write Hit on B1 from node N2
| Home node | N1 |
| Local node | N2 |
| Remote node(s) | N1: C1 holds a copy |
| Sequence of messages | 1. N2 → N1 Invalidate (B1): the request to invalidate the other copies 2. N1 → C1, inside N1: Invalidate (B1) No data is sent: N2 already has the block. |
| B1 in the home directory | State: Modified | Sharer Bits: 0 0 1 0 (owner N2) |
3. Write Miss on B1 from node N0
| Home node | N1 |
| Local node | N0 |
| Remote node(s) | N2: the owner, Modified |
| Sequence of messages | 1. N0 → N1 Write Miss (N0, B1) 2. N1 → N2 Fetch/Invalidate (B1) 3. N2 → N1 Data Write-Back (B1, data); C2: Modified → Invalid; MM1 updated 4. N1 → N0 Data Value Reply (B1) |
| B1 in the home directory | State: Modified | Sharer Bits: 1 0 0 0 (owner N0) |
Three shapes in one exercise: two messages, 1 + k, four. The classic slips are answering the second access with a Write Miss and a Data Value Reply (the block is already in C2) and forgetting, in the first, that the only copy is the home's own. Writing "N1 (the home's own cache), not contacted" for the first remote leaves no doubt about what you mean.
Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where we consider the block B2 in the directory of N2: Directory N2 Block B2 | State: Shared | Sharer Bits: 0 0 1 1 |. Given the following sequence of accesses, please answer to the following questions:
- Write Miss on B2 from node N1
- Read Miss on B2 from node N3
- Write Hit on B2 from node N1
For each access: Home node? Local node? Remote node(s)? What is the sequence of messages sent among the nodes? Which are the final coherence state and sharer bits of the block B2 in the home directory?
Show model answer
1. Write Miss on B2 from node N1
| Home node | N2 |
| Local node | N1 |
| Remote node(s) | N2 (its own cache C2) and N3 |
| Sequence of messages | 1. N1 → N2 Write Miss (N1, B2) 2. N2 → C2, inside N2: Invalidate (B2) 3. N2 → N3 Invalidate (B2) 4. N2 → N1 Data Value Reply (B2 from MM2) |
| B2 in the home directory | State: Modified | Sharer Bits: 0 1 0 0 (owner N1) |
2. Read Miss on B2 from node N3
| Home node | N2 |
| Local node | N3 |
| Remote node(s) | N1: the owner, Modified |
| Sequence of messages | 1. N3 → N2 Read Miss (N3, B2) 2. N2 → N1 Fetch (B2) 3. N1 → N2 Data Write-Back (B2, data); C1: Modified → Shared; MM2 up to date 4. N2 → N3 Data Value Reply (B2) |
| B2 in the home directory | State: Shared | Sharer Bits: 0 1 0 1 |
3. Write Hit on B2 from node N1
| Home node | N2 |
| Local node | N1 |
| Remote node(s) | N3 |
| Sequence of messages | 1. N1 → N2 Invalidate (B2): the request to invalidate the other copies 2. N2 → N3 Invalidate (B2) No data is sent. |
| B2 in the home directory | State: Modified | Sharer Bits: 0 1 0 0 (owner N1) |
Not from a paper: the June 2025 pattern with the home's own copy invalidated in the first access and a Fetch in the second. The second access is the case the notes get wrong (pp. 473 and 477): after the Data Write-Back the memory of N2 is up to date, and both copies are Shared.
(15 July 2024, Question 1) Consider a directory-based protocol for a distributed shared memory system with 4 nodes (N0, N1, N2, N3). Please answer to the following questions:
- What is the definition of home node?
- What is the definition of local node?
- What is the definition of remote node?
- What are the possible messages sent from the local node to the home node?
- What are the possible messages sent from the home node to the local node?
- What are the possible messages sent from the home node to the remote node?
- What are the possible messages sent from the remote node to the home node?
- What are the possible coherence states of a block in the local cache?
- What are the possible coherence states of a block in the home directory?
- What is the meaning of the sharer bits of a block in the home directory?
Show model answer
| Question | Answer |
|---|---|
| 1. Home node | The node whose main memory holds the block, fixed by the physical address; its directory keeps the block's state and sharer bits, and every request for the block goes through it. |
| 2. Local node | The node whose processor issues the request: the read or write miss originates in its cache. |
| 3. Remote node | A node whose cache holds a copy of the block, Shared or Modified. The home may have to invalidate it (a sharer) or fetch the data from it (the owner); the home itself can also be a remote. |
| 4. Local → home | Read Miss (P, A); Write Miss (P, A); Invalidate (A), the request sent on a write hit to a Shared block. |
| 5. Home → local | Data Value Reply (D): the block, in answer to a Read Miss or a Write Miss. |
| 6. Home → remote | Invalidate (A); Fetch (A): the owner returns the block and goes to Shared; Fetch/Invalidate (A): the owner returns the block and invalidates it. |
| 7. Remote → home | Data Write-Back (A, D): the owner's modified block, in reply to a Fetch or a Fetch/Invalidate, or when the owner evicts it. |
| 8. States in the local cache | 1) Invalid 2) Shared 3) Modified. |
| 9. States in the home directory | 1) Uncached 2) Shared 3) Modified. |
| 10. Sharer bits | One bit per node (N0 N1 N2 N3): bit i = 1 means that node i's cache holds a copy. In Uncached all bits are 0; in Shared they mark all the sharers; in Modified exactly one bit is set and it marks the owner. They let the home send Invalidate and Fetch messages only to the nodes concerned, with no broadcast. |
Ten short answers. The marks hide in the directions: Invalidate appears twice (local → home and home → remote), and the remote → home list has a single entry, Data Write-Back — the June 2025 quiz asked exactly that. Keep the two lists of states apart: Invalid belongs to caches, Uncached to the directory.
(15 July 2024, Question 4, SINGLE ANSWER) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N1 Block B1 | State: Shared | Sharer Bits: 1001. Which is the state of the block B1 in N1 after this sequence: Read Miss B1 from local cache N1; Read Miss B1 from local cache N2; Write Hit B1 from local cache N1;
Show model answer
Answer 2. Read Miss from N1: N1 is local and home, the block comes from MM1 and N1's bit is set: Shared | 1101. Read Miss from N2: Data Value Reply from MM1: Shared | 1111. Write Hit from N1: N1 holds a Shared copy, so it sends an Invalidate request to the home (itself), which invalidates N0, N2 and N3: Modified | 0100.
Two traps: in the first access local = home, which changes nothing in the rule — N1's bit is set like any reader's, 1001 → 1101; the last is a write hit, so the final state is Modified with one bit, whatever the bits were before.
(SINGLE ANSWER) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N3 Block B3 | State: Shared | Sharer Bits: 0110. Which is the state of the block B3 in N3 after this sequence: Write Miss B3 from local cache N0; Read Miss B3 from local cache N2;
Show model answer
Answer 2. Write Miss from N0: the home N3 invalidates N1 and N2 and replies to N0: Modified | 1000. Read Miss from N2: the home sends a Fetch to N0, which returns a Data Write-Back and goes to Shared; the home replies to N2: Shared | 1010, memory up to date.
The July 2024 quiz pattern with a read on a Modified block. The wrong options are the entry after one access (Answer 1), a forgotten invalidation (Answer 3) and a reader made owner (Answer 4).
(MULTIPLE ANSWERS) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N0 Block B0 | State: Modified | Sharer Bits: 0100. A Read Miss on B0 arrives from node N2. Which of the following statements are true?
Show model answer
Answers 1, 2 and 4. The sequence is N2 → N0 Read Miss, N0 → N1 Fetch, N1 → N0 Data Write-Back (N1: Modified → Shared, MM0 updated), N0 → N2 Data Value Reply. Final entry: Shared | 0110, memory up to date.
A multiple-answer quiz in the June 2026 form. Answer 4 is the statement the notes get wrong (pp. 473 and 477); Answer 3 describes a real-machine optimization, not the protocol of the papers.
Check yourself
Directory N0 Block B0 | Shared | 0110. N3 sends a Read Miss. Where does the Data Value Reply take the block from?
Directory N0 Block B0 | Modified | 0100. N2's Read Miss has just been served. What does MM0 hold now?
Directory N0 Block B0 | Shared | 1001. N3 evicts its clean copy, then N2 sends a Write Miss. What does the home send?
The home is N0. Which of these transactions use exactly four messages between nodes?
Counting rule: 2 when memory answers, 2 + k for a write miss with k sharers, 1 + k for a write hit, 4 when an owner must be asked, 1 for an owner's eviction.
Why does the directory's state machine have an arc Modified → Uncached but none Shared → Uncached?
Directory N0 Block B0 | Shared | 1000. Write Misses from N1 and N3 reach the home in the same cycle. What does invariant 6 make the home do?
Key take-aways
- Every transaction goes through the home, and its shape is set by the state of the entry and the request: in Uncached and Shared the home answers from its own memory in two messages, plus one Invalidate per other sharer on a write; in Modified it needs four, because the owner must return the block first.
- A clean sharer told to invalidate sends nothing back; the only remote → home message is the owner's Data Write-Back, in reply to a Fetch or a Fetch/Invalidate, or when the owner evicts.
- After a Fetch both copies are Shared and memory is up to date again; after a Fetch/Invalidate memory is fresh only until the new owner writes; after the owner's eviction the entry is Uncached | 0000 and memory is fresh.
- A write hit on a Shared block sends an Invalidate request to the home, which invalidates the other sharers; no data moves, and the entry becomes Modified with only the writer's bit.
- The directory state machine (U, S, M driven by Read Miss, Write Miss and Data Write-Back) is MSI seen from the home; its six invariants — single owner, memory freshness, sharer set, owner membership, defined messages only, one request at a time — are what the messages buy.
- In the exam exercise the home is the node of the entry, the local node is the requester, and the remotes are every other node whose bit is 1, the home's own cache included; cache states are Invalid, Shared, Modified, directory states Uncached, Shared, Modified.
What to watch and read
-
Directory-Based Cache Coherence Protocol Simulator
IIIT Hyderabad, Virtual Labs
Four processors, a directory table with state, sharer vector and owner, and a message log. Use step mode: predict the log of the June 2026 access before you press. Its messages are named Read-Request, Data-Reply, Invalidate, Forward-Request and Writeback — translate them into the papers' names as you go.
-
Directory Example
Milos Prvulovic, Georgia Tech (Udacity)
A short clip that walks a sequence of reads and writes on one directory entry, drawn request by request — the same rhythm as the exam form.
-
The Stanford Dash Multiprocessor
D. Lenoski et al., IEEE Computer, March 199217 pages
The machine the words home and remote come from. Look for Figure 6, "Flow of a read request to remote memory that is dirty in a remote cluster": a read miss on a Modified block in a real design. Compare it with the course's four messages: the dirty cluster sends the data straight to the requester (3a) and a sharing write-back to the home (3b), the shortcut the papers' model does not take.
-
A Primer on Memory Consistency and Cache Coherence, 2nd edition
V. Nagarajan, D. Sorin, M. Hill, D. Wood (open access)
The full directory protocol tables, with the transient states the course leaves out: read the directory chapter when you want to know what really happens while two requests for the same block race.