home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / vms / 15101 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  1.8 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!sdd.hp.com!hplabs!felix!fritz!darnold
  2. From: darnold@felix.filenet.com (Dave Arnold)
  3. Newsgroups: comp.os.vms
  4. Subject: Implementation for global malloc() wanted
  5. Message-ID: <20071@fritz.filenet.com>
  6. Date: 15 Sep 92 22:28:26 GMT
  7. Reply-To: darnold@fritz.filenet.com (Dave Arnold)
  8. Organization: FileNet Corp., Costa Mesa, CA
  9. Lines: 32
  10.  
  11. I need to write a function which has the same calling sequence and
  12. semantics as malloc(), except that the object which is allocated is
  13. stored in global memory (available to all processes), and the address
  14. returned be the same for all processes (shared memory, shared address).
  15. The objects located in shared memory may contain absolute virtual
  16. addresses (linked lists and trees).
  17.  
  18. I have thought of a couple different ways of doing this, none of which
  19. are going to be very easy.  They are:
  20.  
  21. 1)  Create a global section which will contain a heap, and synchronize
  22.     access to the heap using VMS lock management services.  The Global
  23.     section will need to be mapped into a fixed virtual address so that
  24.     shared addresses will work.  Problem:  What address do the processes
  25.     map the section into?  How can I guarantee that the address is not
  26.     already mapped?
  27.  
  28. 2)  Allocate the memory from non paged pool using EXE$ALLOCBUF or
  29.     EXE$ALONONPAGED.  Not sure about all the gotchas here.
  30.     Seems rather risky.  Will the memory be available
  31.     to applications running in user mode?  Can the memory be used
  32.     safely without any threat of corruption and system crashes?
  33.  
  34. VMS is the only OS I know that makes this difficult to do, which I consider
  35. a flaw.  Can anybody think of another way of doing this safely and easily?
  36.  
  37. Thank you!
  38.  
  39. --------
  40. Dave Arnold - KD6IFY    
  41. Internet: darnold@filenet.com    UUCP: uunet!felix!darnold
  42. --- The opinions expressed above are only mine, not FileNet's
  43.