I'm going to try to make this very simple ...

To be re-entrant (in the context of code) means that if a function is
running and by some path it winds up being called again, it will work.
This path might be through the normal call chain on the stack or through
interrupts and signal handlers.  If a function uses a stack frame for all
of its data and state then it is probably re-entrant.  Global data areas
are a red flag.

Many older operating system kernels are not re-entrant because they use
global data areas for the entire OS.  So if you are in a diskette handling
function, somehow leave, and then invoke that same function again you are
probably going to have a bad time.  Filling this example out more
concretely:

   - You are writing a series of disk blocks.
   - The timer interrupt fires, and a TSR that has a productivity tool has
   the timer interrupt hooked so it gets a chance to run.
   - That TSR tries to touch the disk ...  boom.

Now if that TSR just touches the screen, manages the serial port, or
something different, then it's probably safe.  But it's the TSR's
responsibility to avoid things that might blow up because the OS doesn't do
it.

That's what being "non re-entrant" means.  DOS and FreeDOS are not
re-entrant.

Running an entirely new copy of the OS on the same machine doesn't make it
re-entrant.  Those are new invocations with new copies of global data
areas.  Within a single instance of one of these operating systems you are
still not re-entrant.


Mike
(30+ years in big operating systems, embedded firmware, and distributed
systems)
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to