Xref: news-dnh.mv.net comp.os.msdos.djgpp:1006 Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!news.msfc.nasa.gov!bcm!newsfeed.rice.edu!rice!news!sandmann From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: Trapping access to memory... Date: Wed, 19 Jul 1995 15:31:45 CDT Organization: Rice University, Houston, Texas Lines: 18 References: <3uivoo$kql AT kannews DOT ca DOT newbridge DOT com> Reply-To: sandmann AT clio DOT rice DOT edu Nntp-Posting-Host: clio.rice.edu To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp > What I want to do is trap access to a small chunk of memory. I'm currently > .... > routine when 90% of the time it doesn't need it is pretty inefficient. > So is it possible to set up an exception for the chunk I want the 'side affect' Without a bunch of GO32 hacking in V1, the quick answer is no. Even if it was possible, I doubt the overhead of servicing the page fault would be acceptable to you if it happened 10% of the time. And there are limits on using this behavior - everything must be aligned on pages (multiples of 4096 bytes). In V2, the answer is "sort of". With the latest CWSDPMI (or a DPMI 1.0 provider) you can set the protection on pages with mprotect() and install a SIGSEGV signal handler. You would then have even higher overhead than the GO32 hack, and would need to make sure the signal was due to your page protection. Now if it was 99.9% of the time ...