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