elast0ny / shared_memory

A Rust wrapper around native shared memory for Linux and Windows
382 stars 51 forks source link

Allow memory creators to create read only shmem #11

Closed elast0ny closed 6 years ago

elast0ny commented 6 years ago

As some user had mentionned on reddit. It would be nice if you could create shared memory where only the creator can write and other processes can only read. This would enable "safe" sharing with un-trusted processes.

elast0ny commented 6 years ago

Will put this on the back burner... Read only shared memory inst very useful since you cannot add/share synchronization primitives (that need the memory to be mutable, ie: how do you acquire a lock if the lock is read only...).

That means that a creator could share read only memory but any other process trying to read it would have to do it in an unsafe way without synchronization. This could work if the shared memory only contains atomic types or something ?

Would need more examples and how this can work to put effort into this.... Closing for now