Message-Id: Date: Wed, 10 Sep 97 23:32 MET DST To: a DOT hofkamp AT wtb DOT tue DOT nl, djgpp AT delorie DOT com References: <5v3icu$g7s$1 AT sun1000 DOT pwr DOT wroc DOT pl> <5v3n77$e2p AT tuegate DOT tue DOT nl> Subject: Re: Tell me something about `locking' (please). MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT From: Georg DOT Kolling AT t-online DOT de (Georg Kolling) Precedence: bulk Albert Theo Hofkamp schrieb: > In article <5v3icu$g7s$1 AT sun1000 DOT pwr DOT wroc DOT pl>, > _stary_ AT geocities DOT com writes: > > What does `locking' mean? The FAQ mentions two funcitons: one for > > locking code and one for data, but it doesn't explain what they ACTUALLY > > do! All I know is that I should `lock' all data and code `seen' by my > > interrupt handling routine. I feel a bit uneasy about not knowing why > > I'm doing something. > > Basically, you tell the OS not to swap that memory to disk. > 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