Mail Archives: djgpp/2000/05/01/07:54:10
On Mon, 1 May 2000, Alexei A. Frounze wrote:
> > Actually, most of them do, especially if they use RHIDE, Emacs, Less,
> > Info, and other programs. 2Fh/1680h is the function called by the
> > library function __dpmi_yield; most interactive programs call that
> > function inside their idle loop (or if they don't, they should).
>
> But what for? DOS is not a multitasking OS. Windows does all the task/thread
> switches itself. So what is it needed for?
__dpmi_yield is not for task switching, it's for releasing the current
time slice allotted by Windows (or any other multi-tasking scheduler).
When an interactive program waits for the user to type something and has
nothing else to do, it generally should call __dpmi_yield to relinquish
the CPU to other programs that might be waiting for the CPU. Without
this call, Windows will not preempt the CPU before its time slice
expires, and the system might behave is if it is very busy, even though
the program just waits for input.
- Raw text -