home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.msdos.programmer:8953 comp.os.msdos.misc:4988
- Newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc
- Path: sparky!uunet!decwrl!csus.edu!netcom.com!resnicks
- From: resnicks@netcom.com (Steve Resnick)
- Subject: Re: Why ms-dos is non reentrant
- Message-ID: <=wjnyqq.resnicks@netcom.com>
- Date: Tue, 01 Sep 92 17:13:24 GMT
- Organization: What? Me organized? You should see my checkbook!
- References: <92245.122042A10742@TRMETU.BITNET> <BOUILLIN.92Sep1164052@node_3f5e2.ntc.nokia.com>
- Lines: 56
-
- In article <BOUILLIN.92Sep1164052@node_3f5e2.ntc.nokia.com> bouillin@ntc.nokia.com writes:
- >>>>>> On Tuesday, 1 Sep 1992 12:20:42 TUR, Pinar Aydemir <A10742@TRMETU.BITNET> said:
- >
- >> I almost hear everyday that msdos is non-reentrant.
- >> It is non re-entrant so dont call a dos funcion from a Interrupt Service
- >> Routine.
- >> Since It is non reentrant, bla bla bla.
- >
- >> I looked at some books about OS, and the definition of reentrancy is
- >> given as being unmodified (pure) code.So, what makes msdos non reentrant ?
- >> Any information is appreciated.
- >
- >msdos is reentrant because it has been designed so. When writing the
- >code of a particular routine you may tell the compiler that at
- >runtime, either its data segments are fixed (say a memory position) or
- >re-definable (say a new memory position at each call), the latter
- >routine only is called re-entrant. Note such a routine may call itself
- >without any problem... provided it has an exit path (for example after
- >10 times).
-
-
- Claude - What you described is relocateable code. Not reentrancy.
-
- MS-DOS consists of both. The DOS kernel (or at least certain portions)
- reside at specific addresses. This code is not moveable.
-
- Reentrant code is code that can be called either from within itself, or
- code which can be interrupted and called during that interrupt procedure.
-
- Code which operates on global or static data is, generally, non-reentrant.
-
- For example,
- /*** NON REENTRANT ***/
- char foo[1234567];
-
- char foobar(int i)
- {
- foo[i] += '0';
- return foo[i];
- }
-
- /** REENTRANT **/
-
- char foobar(char * foo, int i)
- {
- foo[i] += '0';
- return foo[i];
- }
-
- (Okay, these aren't great examples, but I gotta get back to work <grin>)
-
- --
- ------------------------------------------------------------------------------
- Steve Resnick - resnicks@netcom.com steve@axebbs.kludge.com FidoNet: 1:143/105
- "Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler
- -----------------------------------------------------------------------------
-