From: Newsgroups: comp.os.msdos.djgpp Subject: Re: Are DPMI functions reenterent? Date: Thu, 17 Oct 1996 21:59:00 Organization: Rice University, Houston, Texas Lines: 15 Message-ID: <3266ac24.SANDMANN@clio.rice.edu> References: <3265DD58 DOT 3721 AT rangenet DOT com> Reply-To: SANDMANN AT clio DOT rice DOT edu NNTP-Posting-Host: clio.rice.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > I've been using a dynamic stack instead of a static stack in my > interrupt routines. Is it SAFE to call DPMI functions (501 and 502) > while servicing an interupt. My program used to lock up when I used a > static stack. Well, they are probably safe in CWSDPMI, but they are dirt slow. This may not be the case with all providers, so it's a bad idea. Don't do this. Next - you didn't lock the memory (bad, bad, bad). Once you have swapped to your local stack, it is the locked stack, so you don't need to swap again in the case of nesting (ie, if you enter your interrupt handler with SS what you want, don't change SS:ESP). So only one stack is needed, and it can be pre-allocated (this should have been fixed in the default _go32... wrappers, but never was). You don't check for where the new memory is provided, so it might be outside your current ds/es/... limit (yet another reason to preallocate).