So the Vanilla RC is what is called
the eager release consistent memory model and the
new memory model is called LRC, or Lazy
release consistent memory model. Let's see the pros
and cons of LRC with respect to Vanilla RC, or Lazy RC with respect to Eager
RC. So what I am showing you here
are timelines of processor actions on three different processors,
P1, P2, and P3. And this picture is showing you what happens in the Eager
version of the RC model, in terms
of communication among the processors. So when processor
P1 has completed its critical section, does
the release operation, at the release point what
we're going to do is all the changes that we made, in this example I'm showing
you to make it simple I'm showing you that
in this critical section that I wrote in this
variable x, so the changes to x is going
to be communicated to all the processors, P2 and P3.
It could be, depending on whether it is an
invalidation based protocol or an update based protocol, what
we are saying is we are communicating the coherence
action to all the other processors. That's what these arrows
are indicating. Now then P2 acquires the lock,
and after it acquires the lock it does its
own critical section. Again, let's say we're writing
to the same variable X, and it releases the
lock. And at the point of release once
again we broadcast the changes that we made. Notice
what is going on. P1 makes modifications, broadcasts
it to everybody. But who really needs it? Well,
only P2 needs it. But unfortunately the RC memory
model is Eager, and it says I'm going to
tell everybody that has a copy of X that
I have modified X. And so it's going to tell
it to P2. It's going to tell it to
P3 as well. P3 doesn't care, because it's not using
that variable yet, and P2 cares, and it of
course is using that. But when it releases its critical
section, it's once again going to do exactly
the same thing that happened over here, and that
is it's going to broadcast the changes it made
to shared memory locations to all the other processes,
in this case P1 and P2. And then,
finally, P3 does its acquire, and then reads the
variable. So, all these areas are showing you the
coherence actions that are inherent in the completion of
shared memory accesses that are happening in the
critical section of programs. Now let's move over to
the Lazy version. In the Lazy version, what we
are doing is when we release a lock, we
are not doing any global communication. We simply
release a lock. Later on the next process that
happens to acquire that same lock. The RC memory
model. The first thing it's going to say is,
oh, you want to get this lock? I have
to go and make sure that I complete all the
coherence actions that I've associated with that particular lock. In
this case the previous lock holder had made changes to
the variable x, so I'm going to pull it from
this guy and then I can execute my critical section.
And then when P3 executes its critical section, it's going
to pull it from P2 and complete what it needs
to do. So, the important thing that you see is
that there is no broadcast anymore. It's only point-to-point communication
that's happening between the processors that are passing the lock
between one to the other. So, in other words, the
number of arrows that you see are communication events. You
can see that there's a lot more arrows here. Forget
about the arrows that I introduced. But the black arrows
that you see are the arrows that are indicating communications
commensurate with the coherence actions needed for this
set of critical section actions. And correspondingly, the
black arrows here are showing the communication actions
for the same set of critical section actions
shown in both the top and the bottom
half of this particular figure. You can see,
there's a lot less communication happening with the
Lazy model. It's also called a pull model,
because what we're doing is at the
point of acquisition, we're pulling the coherence
actions that need to be completed over here. Whereas, this is the push model in
the sense that we're pushing all the
coherence actions to everybody at the point of
release. Having introduced the Eager and the
Lazy RC models, it's time for a quiz.