In a computer system which includes a shared main memory, a shared cache memory, a system control element, and a plurality of processors, each processor having a private cache memory for holding lines of memory words, a method for managing access to the words in the cache memories, said method comprising the steps of:
- identifying which data lines in private cache memory have been referenced by two of the plurality of processors while resident in at least one private cache memory, such that each data word in said identified data lines has been referenced by only one of the plurality of processors;
- providing, for the two processors, simultaneous access to respective copies of one of said data lines referenced by the two processors, said respective copies being stored in the respective private cache memories of said processors, wherein each data word in said one data line has been referenced by only one processor;
- marking as shared those data lines in cache memory which have been referenced by two of the plurality of processors while resident in private cache memory, such that at least one data word in each of said data lines has been referenced by the two processors;
- and
- storing into shared cache memory said data lines marked as shared;
- and
- invalidating all copies of said data lines marked as shared in private cache memories.