Patent ID: 7143399

Claim:
A method for prefetching memory pages for a computer program, comprising: analyzing the computer program within a compiler to identify memory pages that are likely to be accessed within a portion of the computer program; creating a map of the memory pages that are likely to be accessed by the computer program, wherein the map is indexed by a program counter for the computer program, so that a given program counter value indexes memory pages that are likely to be accessed after the program counter value is encountered during execution of the computer program; upon return from a thread swap during execution of the computer program, comparing the program counter value to entries in the map, wherein comparing the program counter value to entries in the map involves examining the map using a secondary thread that is synchronized with a program thread that is executing the computer program; and if the current program counter value indexes memory pages in the map, touching the memory pages, so that the memory pages are prefetched before the computer program requires the memory pages, otherwise waiting for the next return from a thread swap to continue comparing the program counter value to entries in the map.