home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / programm / 3313 < prev    next >
Encoding:
Text File  |  1992-12-12  |  1.3 KB  |  38 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!spool.mu.edu!sgiblab!newsun!mlavine
  3. From: mlavine@novell.com (Marc Lavine)
  4. Subject: Re: reentrant code
  5. Message-ID: <1992Dec12.110549.27153@novell.com>
  6. Sender: news@novell.com (The Netnews Manager)
  7. Nntp-Posting-Host: la.sjf.novell.com
  8. Organization: Novell, Inc.
  9. References: <GARY.92Dec9104702@kuwait.gdfwc3> <1992Dec10.045716.12505@linus.mitre.org>
  10. Date: Sat, 12 Dec 1992 11:05:49 GMT
  11. Lines: 25
  12.  
  13. crawford@boole.mitre.org (Randy Crawford) writes:
  14.  
  15. >But reentrant code is meant to remain 
  16. >in memory after a context switch, allowing another task to reuse the memory 
  17. >and save the cost of swapping it out and then back in immediately.
  18.  
  19. I believe that you may be confusing reentrancy with shared code.
  20. Reentrancy has nothing to do with swapping memory or tasks around.
  21. You may also be confusing context switching and swapping.  Context
  22. switching does not generally have to do with swapping anything other
  23. than values in registers.
  24.  
  25. Here's how I'd describe reentrant code:
  26.  
  27. A section of code is reentrant if it will function properly when it is
  28. entered by a thread and then entered again without the thread that
  29. previously entered the code having exited the code yet.
  30.  
  31. This has nothing to do with the O/S moving memory around.
  32. -- 
  33. Marc Lavine
  34. mlavine@Novell.Com
  35. -- 
  36. Marc Lavine
  37. mlavine@Novell.Com
  38.