Mail Archives: djgpp/1997/05/09/10:06:57
At 03:00 9-5-97 PDT, you wrote:
>I have downloaded LWP (the pre-emptive multitasking library for DJGPP), and
>wrote a couple of simple example programs with it to try it out. It seems
a very
>interesting library, but I have a few questions:
I can't answer all of them, but I'll give a try...
>1. What exactly is the difference between pre-emptive and co-operative
>multitasking, and why is pre-emptive described as being kuhl whilst
co-operative
>is bleh (in the documentation)?
Pre-emptive multitasking is done by the OS (more precise the cpu
scheduler), which gives each task a period of time. After that period of
time, the scheduler switches to the next process. And so on.
A task that's co-operatively multitasked releases the cpu by itself, either
by terminating or entering the wait state. Therefore a bad programmed task
can lock up the system, because it doesn't release the cpu.
[snip]
>5. What are re-entrant and non re-entrant, and how is it possible to
ensure my
>functions are re-entrant?
Re-entrant code can be interrupted by the OS without 'problems'. DOS is non
re-entrant: it's not a multi task system.
Hope that helped.
Erik Post
Student Computer Sciences at University of Twente, The Netherlands
e-mail: erik DOT post AT student DOT utwente DOT nl
- Raw text -