www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/09/10:06:57

Message-Id: <3.0.1.32.19970509160624.00e79360@mail.student.utwente.nl>
Date: Fri, 09 May 1997 16:06:24 +0200
To: "Alex Holden" <bigal2000 AT hotmail DOT com>
From: Erik Post <erik DOT post AT student DOT utwente DOT nl>
Subject: Re: Some questions about LWP.
Cc: djgpp AT delorie DOT com
In-Reply-To: <199705091000.DAA11691@f39.hotmail.com>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019