deepns / deepns.github.io

My Github Pages site
https://deepanseeralan.com/
0 stars 0 forks source link

tech/playing-with-shared-memory/ #2

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Playing with shared memory in Linux and macOS - Deepan Seeralan

Reading the operating system internals is like going down the rabbit hole. It is so easy start at one topic, get lost and end up in a totally different topic. On one such journey sometime back, I ended up at shared memory, one of the frequently used inter process communication mechanisms. If we are to communicate between parent and child processes, we could do so through a memory region in the parent’s address space since that is accessible to the child process as well. Here is an example.

https://www.deepanseeralan.com/tech/playing-with-shared-memory/

bodqhrohro commented 3 years ago

I suppose you misplaced Linux and macOS listings.

tkothadev commented 1 year ago

Hi Deepan,

Thanks for your work on exploring shared memory pages. I have a question for you if you don't mind.

If I want to share multiple memory segments between 2 processes (say I have one shared segment for holding a common image buffer, and another for streaming command data), how could I do that in this system. I'm running into an issue with OSX where the first process creates 2 segments successfully, but the second process fails in accessing the second segment (it seems to succeed with the first from what I can tell).