Mail Archives: djgpp/2001/03/31/08:02:40
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.
- Raw text -