Quote:
|
Originally Posted by porter
1. Understand the process memory map on a particular OS.
2. attach the shared memory as early as possible in the process startup to prevent that memories use by other later activities.
3. if you fork, you will have two processes using the shared memory at the same address, I can't confirm if when you exec() the shared-memory actually gets detached. Would be worth finding out?
|
It is the 2 part that worries me. Writing a shared library that "insists" that it gets a certain region of memory to attach to seems prone to issue. However, writing it to attach to various different regions seems prone to issue too because all applications must attach to the same region if pointers are to be valid across them.
Humm...maybe it should be configurable...doesn't seem fair, however, to make the user set a value. Grrrrrrrr... Always a trade-off...make it fast, or make it reliable.... The reliable route would be to store all "pointers" as offsets...or page/offset pair. But, that means that the application must always translate my pointer type into the actual pointer.... Slow...tedious, error-prone. Grrrrrrrrrrrrr!!!!!!!!!