Previous | Next --- Slide 19 of 52
Back to Lecture Thumbnails
cwchang

Doesn't the definition of TSO and PC kind of conflict? The former says "reads by other proc cannnot return new value of A until the write to A is observed by all proc", while the latter says "any proc can read new value before the write it observed by all proc".

How should I interpret these two definition?

yeq

Please correct me if I am wrong. From my point of view, what TSO guarantees is that if a processor A reads some data X (which may not be the latest value), any processors that read after A will not read an older version of X than that read by A.

thunder

@cwchang I think the two definitions are two protocols of relaxing Read after Write. We can take the example in the slide. For TSO, it guarantees that when a processor returns the new value of A, the values of A observed by all other processors will be the new value. But for PC, when a processor return the new value of A, the values of A observed by other processors can be the new value of A or the old value of A. In this case, both PC and TSO only relax the Read after Write operations. The difference is that PC is more relaxed than TSO in terms of dealing with new values of writes.

jkorn

@yeq not exactly. In the slide above, we are looking at the W -> R order, where A is written and B is read. So what TSO says is that processor P writes A, and reads B before the write completes. All other processors then only read the new value of A when it reaches EVERY processor (where the new value of A takes different times to reach different processors), and until then still read the old value of A (call it A').

This differs from PC, where some processors that have received the new value of A can read that, and others who have yet to receive the value can read A'.

maddy

Is it right to say that in case of TSO, the read after write is relaxed only for local writes(PrWr) but in the case of PC, read after writes are relaxed for both local and remote(BusWr) writes?

paracon

@maddy, I don't think that would a correct interpretation. Read before write weak consistency model only talks about reordering reads and writes in the same processor. @jkorn's comment states their difference pretty well.

lfragago

My explanation of TSO vs PC in simple terms:

Total store ordering (TSO): If processor P_0 saw the write, then by that point all processors P_1, P_2,P_3 must also see the newest value written.

Processor Consistency (PC): By the time P_0 saw the write, we are not guaranteed that P_1, P_2,P_3 also saw the write.

shhhh

Why is only W->R relaxed? What's wrong with relaxing R->R. In fact, why is R->R necessary? I can't think of a case where this would be a problem.

jkorn

@shhhh that is talked about in a further slide. In this case TSO and PC just refer to when W->R is relaxed.

locked

TSO is more strict than PC. TSO:W->R is relaxed, but other processors cannot read that A until A is propagate to all thread. PC:W->R is relaxed, but other processors can read A even if new value of A haven't been propagated to all processors.

nishadg

In what cases would the advantages of allowing this reordering be outweighed by the overhead required to maintaining consistency?

fxffx

There are one thing unclear in this slide. For TSO, can a processor saw its own read on A before its write to A? If not, the second point in TSO shouldn't start with "Reads by OTHER processors".