From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP Interrupt programs running under Win98 Console Date: Sat, 31 Mar 2001 09:43:06 +0200 Lines: 26 Message-ID: <3AC58A8A.F1797197@is.elta.co.il> References: <2110-Thu29Mar2001220437+0200-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: diup-219-21.inter.net.il (213.8.219.21) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 986024642 3808799 213.8.219.21 (16 [61365]) X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Kevan Roberts wrote: > > > This is a Windows ``feature'': only a program that is in the > > foreground gets the timer interrupts. Programs which run in the > > background get only a very small portion (about 10%) of the timer > > interrupts. That's multitasking, Bill Gates style. > > > I'm still confused - I'd naievely assumed I'd chained onto the one and > only hardware timer interrupt in Windows. This interrupt occurs whether > my program is in the foreground or background. This can only mean that > I've registered a 'virtual' handler that in reality is managed by > Windows. Is this right?? Of course, it's right. Windows allows to create multiple DOS session, each one of them having an illusion that it ``owns'' the entire machine, including memory, I/O ports, and peripheral devices. The only way Windows can do that is by virtualizing every aspect of the machine's hardware. For the timer interrupt, there's another issue: Windows needs to hook the timer interrupt for itself: that's how it implements the preemptive multitasking. It also reprograms the timer, because its time slice is not 54msec. The virtualization is not the problem, though: the problem is that Windows decided background programs don't need to get the timer interrupts at their normal rate.