Multi-core Cache consistency maintenance method and device based on fence and lock

Disclosed is a multi-core Cache consistency maintenance method and device based on a fence and a lock. The method includes that for shared data having the same address, when a read-write operation among multi-cores is carried out, firstly through a hardware fence to assure that an operation of write data cores obtaining hardware lock precedes a query operation of read data cores for a hardware lock. Secondly, after the hardware lock is obtained, the write data starts to carry out the write operation, and releases the hardware lock after copies of the other cores cache space are abolished. The other cores firstly need to query the state of the hardware lock before reading data, until the hard ware lock is released, start to carry out the read data operation. The device is used to perform the method. The invention has advantages such as a simple structure, flexible use, and a high usability of programming.

[1]  Gianluca Palermo,et al.  Efficient Synchronization for Embedded On-Chip Multiprocessors , 2006, IEEE Transactions on Very Large Scale Integration (VLSI) Systems.