This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mlock in cache


On 08/02/2013 03:12 PM, Christos wrote:
> Hi everyone,
> 
> I am developing a program in C and I want to lock some memory pages in 
> cache, particularly in the core specific level (i.e. level 1). As far as 
> I know the C libraries do not provide an interface to do that so I guess 
> that there must be some particular directives in gcc to do so.

__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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]