Patent ID: 7356653

Claim:
A method of optimizing memory synchronization through software in a multi-threaded computer system using a reader-initiated memory synchronization process, the method comprising: executing in a first processor at least one computational activity requesting an exclusive access to a shared memory; and using a multi-field lock associated with the shared memory to obtain the exclusive access to the shared memory, wherein obtaining the exclusive access comprises: inspecting the multi-field lock to determine whether the multi-field lock is reserved for the first processor; wherein said reservation indicates that a processor reserving the multi-field lock has priority in a race condition for future acquisition of the lock, and the reserving processor does not require performing memory synchronization on future acquisition of this lock; and wherein when the multi-field lock is not reserved for exclusive use by the first processor, the first processor performs steps of: when the multi-field lock is reserved by a second processor and the second processor did not previously perform the synchronization operation when it last released the lock: synchronizing the shared memory by the second processor; updating the multi-field lock reservation; and performing an instruction synchronization for the first processor.