mlock in cache

Fri Aug 2 15:03:00 GMT 2013

On 08/02/2013 03:27 PM, Andrew Haley wrote:
> __builtin_prefetch() is what you need. However, there's no way you'll 
> be able to lock anything in L1: it'll be evicted very shortly 
> afterwards. Andrew. 

Sorry for that, but from what I see __builtin_prefetch() just fetches in 
advance the related pages but it does not guarantee that thy won't be 
thrown out of the cache. I want to know if there is some way to prefetch 
and lock some memory unit in cache. I'm pretty sure that there should be 
a way for this to be done in assembly, but I don't know for C or some 
gcc built-in

Christos Tsopokis

More information about the Gcc-help mailing list