I am using a Memory mapped file to cache a large amount of data for an ASP.NET application. At the moment I am using the global.asax event to open the file and get a memory mapped file handle which I cache in the application object. If I dereference that handle to a pointer and try to cache the pointer in my httphandler, I get a protection exception when I reference the pointer so I am caching the handle to the Memory Mapped File and dereferencing it to a pointer inside my httphandler. This seems to work fine and is pretty quick so I am assuming it is only loading the file into real memory the once. The problem is that when the load increases I get multiple httphandler instances running at the same time and each one seems to dereference the handle to a different address. This results in running out of address space pretty quickly. Short of going to 64 bit, is there some way to force managed code to share a common chunk of memory between threads? Is there a better way to acomplish what I am trying to do here?
Thanks in advance,
Brian