What should happen, when the process owning a piece of data decides to unshare it while other processes share the data as well? ???
Should they be killed at once as they cannot use the data anymore? Should they be killed when accessing the shared data? Should I copy the physical adresses of the data's pages and not dispose them when the first process dies?
Cheers,
~Adrian
shared memory- when the object is destroyed?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:shared memory- when the object is destroyed?
that mainly depends on what you plan to do with the object. Imho, an object that is no longer owned by any process should be released (though that's not the way it works in Unix). You could also imagine to receive a signal telling "peer X using the shmem is now gone", and do whatever you want with the info (release aswell, respawn a process, etc.)
Re:shared memory- when the object is destroyed?
Unless you want to introduce some sort of persistance into the shared memory, then you should probably have a reference count on them so that when the last user releases it, the memory is freed.