Subj : Re: What is the real costs of LOCK on x86 multiprocesor machine? To : comp.programming.threads From : chris noonan Date : Fri Aug 05 2005 11:10 am Joe Seigh wrote: > MESI is required to maintain coherency so that only one > processor has a cache line exclusive at a time and thus > keeping updates from getting lost. If you didn't have > false sharing, you wouldn't need this. OK. I hadn't considered that. It makes a difference to the "Active Memory Operations" way of doing things. Consider there to be three types of variable: thread-private data, shared data and semaphores. Without MESI, it might be thought possible for a thread that only *reads* some shared data not to see the writes of other processors, as it might keep reading the stale data in its cache. But normally such an access would be part of a readers/writers solution, hence protected by semaphore and an explicit cache fill (in the setup I described earlier). If thread-private data, shared data and a semaphore happen to lie in the same cache line, there is no problem (except for some redundant refreshes of the thread-private data). There is a problem if two different sorts of shared data (such as the data protected by two unrelated critical regions) lie in the same cache line; writes could be lost. That would have to be solved by attention to the memory layout. Chris .