home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4398 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.2 KB  |  46 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!newshost.uwo.ca!uwovax.uwo.ca!7103_2622
  3. From: 7103_2622@uwovax.uwo.ca (Eric Smith)
  4. Subject: Re: Can a TSR Malloc()?
  5. Organization: University of Western Ont, London
  6. Date: Thu, 13 Aug 1992 00:16:05 GMT
  7. Message-ID: <1992Aug12.201605.1@uwovax.uwo.ca>
  8. References: <sourada.713595993@vincent1.iastate.edu> <1992Aug12.095216.1@uwovax.uwo.ca> <1992Aug12.181935.11706@mnemosyne.cs.du.edu>
  9. Sender: news@julian.uwo.ca (USENET News System)
  10. Nntp-Posting-Host: hydra.uwo.ca
  11. Lines: 33
  12.  
  13. In article <1992Aug12.181935.11706@mnemosyne.cs.du.edu>, ilepore@nyx.cs.du.edu (Ian Lepore) writes:
  14. >  I've always thought it should be possible to temporarily change TOS's _run
  15. > variable temporarily so that it points to the TSR's basepage during the 
  16. > Malloc() then gets set back to the proper value.
  17.  
  18. Aack! No, don't do this (it's precisely this "trick" that I warned you
  19. would break!). I think this is exactly why Atari warned people not
  20. to change _run. (If you're interested: MiNT doesn't use _run at all for
  21. memory management, because MiNT doesn't care about basepages, only
  22. about process id's -- this allows for funky things like fork() and
  23. vfork().)
  24.  
  25. >  Seriously, though...it would be nice to have an alternate form of Malloc()
  26. > usable by TSRs and desk accessories...something where you could pass a  
  27. > pointer to the basepage of the process that should own the memory.
  28.  
  29. There's a much better solution -- don't TSR! If your program is
  30. running under MultiTOS or MiNT, it doesn't have to terminate in order
  31. to stay resident; it can just run in the background. It can then do
  32. Malloc or file calls with no problems. If it wants to install some
  33. code in a vector that other processes can use, that code should use
  34. one of the (many) inter-process communication methods to send the
  35. Malloc request over to the "main" application which is hanging around
  36. in the background.
  37.  
  38. The Ptermres() call was a rather ugly hack that Microsoft invented to
  39. make up for the lack of multitasking in MS-DOS. I think it's outlived
  40. its usefulness.
  41. --
  42. Eric R. Smith                     email:
  43. Dept. of Mathematics            eric.smith@uwo.ca
  44. University of Western Ontario
  45.  
  46.