Mail Archives: djgpp/2000/05/01/09:58:48
Eli Zaretskii wrote:
> On Mon, 1 May 2000, Alexei A. Frounze wrote:
> > 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).
Just some kind of a synonym. :)
> 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.
Do you bother about that while you're programming? I.e. do you write a custom
keyboard read function that calls that thing?
Or maybe we all develop applications for background that should work and be
invisible? I dboubt. :)
How about old DOS programs? Are you sure all they release timeslice?
I bet most of programmers don't bother about that because it's not a thing to
worry too much about. It is just a way to help sheduler make a decision,
although it doesn't need any help in general. Usually all the time is given to a
current (current for the user) task and most of users don't expect/need
something else.
bye.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
- Raw text -