• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Shared memory multiprocessor architecture and processor registers

Hello !

I'm running a pretty advanced CCNUMA-multiprocessor simulator called RSIM, using the MESI cc-protocol. I have been running some programs, using the simulator's shared memory model with 4 processes and 4 processors. The specific architecture/programs is not interesting in this case...Some global (shared) variables can be declared as local to increase the performance of the applications, because the variables are initialized once and then only read (not modified) during the entire simulation by the processors.
My question is: Could this be explained by the fact that the compiler assign local variables into registers ?
If I'm not wrong shared variables canno't be loaded into registers (this is the same for SMP's I guess), because registers are not covered by the
cc-protocol , or ?😕
 
right, you have to keep shared stuff in memory, never keep it in a register for even the shortest amount of time,
and modify it only in an atomic read-modify-write instruction. Only with these precautions can the system's cache
coherency protocol do the right thing.

Shared data that are never modified will usually be in each processor's cache pretty soon (in S state), so the performance
benefit from keeping it in a register is one cache access latency, which isn't much ... you might lose more when you
have to do your actual computation with one register less. This often happens on our beloved x86 architecture.

regards, Peter
 
Back
Top