Question: 3 - Consider a critical section of a code that is protected by lock and unlock primitives as shown below. Suppose the two processors (

3- Consider a critical section of a code that is protected by lock and unlock primitives as shown below. Suppose
the two processors (P0 and P1) running the code are both trying to acquire a lock at address 0x100(i.e., register
R1 holds the address 0100). The SMP uses the MESI cache coherence protocol and implements cache-to-cache
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 (i.e.,11-sc pair for P0 occurs before 11-sc pair for P1)
PrRd and PrWr misses, if satisfied by the main memory and cache (i.e., cache-to-cache transfer), require
Nmemory=80 and Ncache=35 cycles, respectively.
PrWr hits that cause invalidations incur Ninvalidate=15 cycles.
PrWr hits that do not cause any bus activity incur no stalls.
Assume the critical section is 1200 cycles long.
lock:
 3- Consider a critical section of a code that is protected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!