top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

lock some memory pages in cache using C

0 votes
358 views

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. I am interested in locking both a struct and some arbitrary variables.

Could any one provide any information for that? If so it would be very helpful.

posted Aug 2, 2013 by Jagan Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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

answer Aug 2, 2013 by Meenal Mishra
Similar Questions
+3 votes

How can we implement an LRU cache using just a single container i.e. map or unordered_map?

Expected operations:
1. find(key_t) - find a certain value in cache
2. insert(key_t, value_t) - insert a new value to the cache

+4 votes

how to clear cache memory from browser using php?

+1 vote

My system is set to go directly to the OpenDNS name servers for DNS resolution. However, the results I get from "nslookup" differ from what I get if I query the same name server from another machine with the same resolv.conf settings.

That leads me to believe that DNS info is being cached locally somewhere. I don't have bind or nscd installed.

Where is this caching taking place and how can I clear/flush it?

...