Date: Thu, 11 Sep 1997 10:31:20 +0300 (IDT) From: Eli Zaretskii To: Georg Kolling cc: a DOT hofkamp AT wtb DOT tue DOT nl, djgpp AT delorie DOT com Subject: Re: Tell me something about `locking' (please). In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 10 Sep 1997, Georg Kolling wrote: > > The reason is that in the interrupt vector of the machine you set the > > address of your routine, and the machine expects it to find it there when > > the interrupt occurs, which might not be the case if the OS is allowed to > > swap the memory out. > > This wouldn't be a real problem since accessing swapped pages causes an > exception where the OS exception handler should write those pages back to > memory. The big problem is time since your program isn't expecting a memory > access to take a few seconds, which can mess up your program if it depends on > timer interrupts No, the swap-in *is* the real problem, because DOS is non-reentrant. Swapping in from disk requires a DOS function, and if the interrupt that caused those pages to be swapped in itself happened when some other DOS function was in progress (e.g., the foreground program was reading a file), your system will crash. Having a hardware interrupt serviced slowly is bad, but not as bad as crashing the entire machine.