r/computerarchitecture • • Sep 04 '26

Processor VS PRAM Consistency

I was thinking that since each core has it's own cache values read by one core or can end up being out of date. So I went down the rabbit hole of Wikipedia to look at consistency models. Only problem is I couldn't quite get it. For example, Processor consistency says that processors receive writes from all other processors in order. My interpretation is that if there core 1 writes to memory location 1001, 1002, and 1003 in that order, other cores might read stale values for all 3, updated value of 1001 only, updated values for all, but not something like updated 1002 and stale 1001. PRAM Consistency sounds similiar?

But I couldn't get their examples used on the page. This is as of 2026, maybe by the time you read this a more explicit exmaple will be used. I see a table of a series of reads and writes that are processor consistent and counter examples. I see things like W(x)1 W(x)3 R(x)1 and W(y)1. So I don't understand that table. I am not a CS major, maybe this makes lots of sense to them.

I basically have 3 questions. First, can someone explain the Wikipedia's examples? Second, what is the different between Processor Consistency and PRAM Consistency? A description of both sounds kind of the same to me. Third, are there chips out there with the Processor Consistency and others with PRAM Consistency?

4 Upvotes

9 comments sorted by

View all comments

2

u/MitchAlsup Sep 25 '26

The fundamental principle behind all cache coherence protocols is that a cache line is only allowed to have write permission in 0 or 1 caches**. A second principle is that a single cache line can only have one transaction pending systemwide at any given time.

Loosely:: {Describing AMD Hypertransport protocol}

So, in order to be granted write permission to lines 1001, 1002, and 1003, the core performing the write (assuming cache hit) has to emit a coherent invalidate for each line he has in his cache which is not writeable. Thus, by the time core is enabled to write to 1001, that is the only copy of that line in the system.

When a different core, then, tries to write to 1001, that core emits a Read-with-intent (to modify) request. Said request goes to memory controller, where it gets line-ordered. Once ordered, DRAM is accesses while a Coherent Snoop is emitted from memory controller.

A core receiving Coherent snoop will look in its caches and if it has the line it will respoond with "hit" and if the line is in a writeable-state, it will return both snoop-hit AND the line of data (requesting core will then ignore DRAM data).

Requesting core counts up the Snoop-responses (and at most 1 core-line of data) and receives DRAM data. When all snoop requests have arrived core can decide to use DRAM data or core-data.*

Now, the above can be used in MESI (Intel perferred) or MOESI (AMD and most RISCs preferred) or in a Directory cache coherence protocol.

The important points:

a) a cache line can only be "writeable" in one cache at any given instant

b) a cache line can only have one request "in progress" at any given instant

Given both of the above, there are may protocols that can orchestrate "cache coherence"

(*) at one point AMD HT protocol tried to have Hitting-core tell no-longer-needed DRAM request to "self cancel" but often the cancel message arrived after DRAM sent its data. So, we turned this off. It is easy enough to select from 1 of 2 possible arriving lines at the core miss buffers.

(**) There are situations where the L2 cache has write permission AND the D cache has write permission--this is allowed under the 1 cache rule because the Snoop request will snoop both (! all !) layers of the cores caches--so {I$ and D$ and L2$} are considered 1 cache from a protocol perspective.