Question: 3 - Consider a critical section of a code that is protected by lock and unlock primitives as shown below. Suppose the two processors (
Consider a critical section of a code that is protected by lock and unlock primitives as shown below. Suppose
the two processors and running the code are both trying to acquire a lock at address ie register
R holds the address The SMP uses the MESI cache coherence protocol and implements cachetocache
transfer. Determine the total number of cycles required for both processors to execute their critical sections.
Initially, only the main memory has the block that contains the lock, and thus the block in both caches are in
Invalid I state. Assume the following:
The processors acquire the lock in order iesc pair for P occurs before sc pair for P
PrRd and PrWr misses, if satisfied by the main memory and cache ie cachetocache transfer require
and cycles, respectively.
PrWr hits that cause invalidations incur cycles.
PrWr hits that do not cause any bus activity incur no stalls.
Assume the critical section is cycles long.
lock:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
