home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8953 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  2.4 KB

  1. Xref: sparky comp.os.msdos.programmer:8953 comp.os.msdos.misc:4988
  2. Newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc
  3. Path: sparky!uunet!decwrl!csus.edu!netcom.com!resnicks
  4. From: resnicks@netcom.com (Steve Resnick)
  5. Subject: Re: Why ms-dos is non reentrant
  6. Message-ID: <=wjnyqq.resnicks@netcom.com>
  7. Date: Tue, 01 Sep 92 17:13:24 GMT
  8. Organization: What? Me organized? You should see my checkbook!
  9. References: <92245.122042A10742@TRMETU.BITNET> <BOUILLIN.92Sep1164052@node_3f5e2.ntc.nokia.com>
  10. Lines: 56
  11.  
  12. In article <BOUILLIN.92Sep1164052@node_3f5e2.ntc.nokia.com> bouillin@ntc.nokia.com writes:
  13. >>>>>> On Tuesday, 1 Sep 1992 12:20:42 TUR, Pinar Aydemir <A10742@TRMETU.BITNET> said:
  14. >
  15. >> I almost hear everyday that msdos is non-reentrant.
  16. >> It is non re-entrant so dont call a dos funcion from a Interrupt Service
  17. >> Routine.
  18. >> Since It is non reentrant, bla bla bla.
  19. >
  20. >> I looked at some books about OS, and the definition of reentrancy is
  21. >> given as being unmodified (pure) code.So, what makes msdos non reentrant ?
  22. >> Any information  is appreciated.
  23. >
  24. >msdos is reentrant because it has been designed so. When writing the
  25. >code of a particular routine you may tell the compiler that at
  26. >runtime, either its data segments are fixed (say a memory position) or
  27. >re-definable (say a new memory position at each call), the latter
  28. >routine only is called re-entrant. Note such a routine may call itself
  29. >without any problem... provided it has an exit path (for example after
  30. >10 times).
  31.  
  32.  
  33. Claude - What you described is relocateable code. Not reentrancy.
  34.  
  35. MS-DOS consists of both. The DOS kernel (or at least certain portions)
  36. reside at specific addresses. This code is not moveable.
  37.  
  38. Reentrant code is code that can be called either from within itself, or
  39. code which can be interrupted and called during that interrupt procedure.
  40.  
  41. Code which operates on global or static data is, generally, non-reentrant.
  42.  
  43. For example,
  44. /*** NON REENTRANT ***/
  45. char foo[1234567];
  46.  
  47. char foobar(int i)
  48. {
  49.     foo[i] += '0';
  50.     return foo[i];
  51. }
  52.  
  53. /** REENTRANT **/
  54.  
  55. char foobar(char * foo, int i)
  56. {
  57.     foo[i] += '0';
  58.     return foo[i];
  59. }
  60.  
  61. (Okay, these aren't great examples, but I gotta get back to work <grin>)
  62.  
  63. -- 
  64. ------------------------------------------------------------------------------
  65. Steve Resnick - resnicks@netcom.com steve@axebbs.kludge.com FidoNet: 1:143/105
  66. "Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler
  67. -----------------------------------------------------------------------------
  68.